It was related to proxy. After adding the below commands I was able to create new project as well as install node modules.
No need to downgrade Node in my case.
> npm config set registry http://registry.npmjs.org
> npm config set https-proxy https://registry.npmjs.org/@angular%2fcli
The reason you are getting this error is because the script (npm in this case) is expecting JSON, but is getting HTML instead. The bigger question is what is in that HTML document; maybe advice to use latest Angular version… who knows!
3
Answers
It was related to proxy. After adding the below commands I was able to create new project as well as install node modules. No need to downgrade Node in my case.
Angular 13 supports only upto
^12.20.0 || ^14.15.0 || ^16.10.0
please install withinnode 12 - node 16
and retry the command, maybe it will work!Angular node compatibility reference link
Alternative solution will be you install the latest angular the steps are as follows
Optionally you can install core module also
Then you can retry the command and see if it works!
The reason you are getting this error is because the script (
npm
in this case) is expecting JSON, but is getting HTML instead. The bigger question is what is in that HTML document; maybe advice to use latest Angular version… who knows!