Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Re install fails if user setting file is not valid json #3151

Closed
Meyer-dev opened this issue Oct 9, 2017 · 2 comments
Closed

Re install fails if user setting file is not valid json #3151

Meyer-dev opened this issue Oct 9, 2017 · 2 comments
Assignees
Milestone

Comments

@Meyer-dev
Copy link

Meyer-dev commented Oct 9, 2017

On reinstalling nativescript; error in CLI:

Unexpected token   in JSON at position 0
Failed to display command help SyntaxError: Unexpected token   in JSON at position 0
    at Object.parse (native)
    at FileSystem.readJson (C:\Users\Renier weitz\AppData\Roaming\npm\node_modules\nativescript\lib\common\file-system.js:171:25)
    at UserSettingsService.<anonymous> (C:\Users\Renier weitz\AppData\Roaming\npm\node_modules\nativescript\lib\common\services\user-settings-service.js:92:46)
    at next (native)
    at C:\Users\Renier weitz\AppData\Roaming\npm\node_modules\nativescript\lib\common\services\user-settings-service.js:7:71
    at __awaiter (C:\Users\Renier weitz\AppData\Roaming\npm\node_modules\nativescript\lib\common\services\user-settings-service.js:3:12)
    at UserSettingsService.loadUserSettingsData (C:\Users\Renier weitz\AppData\Roaming\npm\node_modules\nativescript\lib\common\services\user-settings-service.js:82:16)
    at UserSettingsService.<anonymous> (C:\Users\Renier weitz\AppData\Roaming\npm\node_modules\nativescript\lib\services\user-settings-service.js:20:24)
    at next (native)
    at C:\Users\Renier weitz\AppData\Roaming\npm\node_modules\nativescript\lib\services\user-settings-service.js:7:71
Error while reporting exception: SyntaxError: Unexpected token   in JSON at position 0

Is there something I'm not doing correctly on reinstallation? any help would be greatly appreciated.Thanks :)

@rosen-vladimirov
Copy link
Contributor

Hey @Meyer-dev ,
Can you check the content of your C:\Users\Renier weitz\AppData\Roaming\.nativescript-cli\user-settings.json file and see if it is valid JSON? I've seen such errors in the past that were raised when the file has incorrect content. If this is the case, can you please delete the file and run any CLI command again.
Also, if this is the case, may I ask if you have used yarn to install/update CLI?

@Meyer-dev
Copy link
Author

Meyer-dev commented Oct 10, 2017 via email

@NickIliev NickIliev reopened this Oct 12, 2017
@NickIliev NickIliev changed the title Error without obvious solution? Error: Unexpected token in JSON at position 0 Oct 12, 2017
@dtopuzov dtopuzov changed the title Error: Unexpected token in JSON at position 0 Re install fails if user setting file is not valid json Nov 8, 2017
@Fatme Fatme added this to the 4.0.0 milestone Mar 9, 2018
@Fatme Fatme self-assigned this Mar 9, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

6 participants