Parsing .angular-cli.json failed.
Bug Report or Feature Request (mark with an x)
- [x] bug report -> please search issues before submitting
- [ ] feature request
Parsing .angular-cli.json failed. Please make sure your .angular-cli.json is valid JSON. Error: SyntaxError: Unexpected token u in JSON at position 22
I'm getting this issue no matter what I do now, from ng -v to ng new to anything ng related. What I did was merely changed to global manager to yarn and everything starts to break. I tried reinstalling @angular/cli, removing node_modules from library and nothing works. I can't find this .angular-cli.json file.
Versions.
$ node -v v7.7.4 $ npm -v 4.1.2
Repro steps.
The log given by the failure.
Parsing .angular-cli.json failed. Please make sure your .angular-cli.json is valid JSON. Error:
SyntaxError: Unexpected token u in JSON at position 22
InvalidConfigError: Parsing .angular-cli.json failed. Please make sure your .angular-cli.json is valid JSON. Error:
SyntaxError: Unexpected token u in JSON at position 22
at Function.fromConfigPath (/usr/local/lib/node_modules/@angular/cli/models/config/config.js:74:19)
at Function.fromProject (/usr/local/lib/node_modules/@angular/cli/models/config.js:91:46)
at Object.
Desired functionality.
Mention any other details that might be useful.
The error looks like it's to do with malformed JSON. I'm guessing you have a trailing comma somewhere or unquoted string :)
Could you share your .angular-json?
@MaxGoh You said you can't find the file. If you are on an *unix platform it'd be hidden. Just a reminder :)
Look at character 22, there should be a u there that is out of a string. Sometimes people think that undefined is valid JSON but it's not.
Hope this helps. I'm going to close this as resolved.
This started happening on my system after trying to set the package manager to yarn. ng new stopped working. I then realized that there was a .angular-cli.json file added in my home directory, containing the following:
{
"packageManager": undefined
}
Which isn't valid JSON. Deleting this file fixes everything. Same issue seems to be occurring in #6087
This issue has been automatically locked due to inactivity. Please file a new issue if you are encountering a similar or related problem.
Read more about our automatic conversation locking policy.
This action has been performed automatically by a bot.