skip to Main Content

Whenever I’m trying to execute any node commands/create new angular project I’m getting the below error.
Node version 20.11.0
NPM version 10.2.4

enter image description here

enter image description here

3

Answers


  1. Chosen as BEST ANSWER

    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
    

  2. Angular 13 supports only upto ^12.20.0 || ^14.15.0 || ^16.10.0 please install within node 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

    npm install -g @angular/cli@latest
    

    Optionally you can install core module also

    npm install -g @angular/core@latest
    

    Then you can retry the command and see if it works!

    Login or Signup to reply.
  3. 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!

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search