angularnpmangular-clinpm-installangular19

Problems when setting up the environment (Angular)


I followed this tutorial https://angular.dev/tools/cli/setup-local to set up local environment and workspace (Angular).

The npm version was 10.9.0 and node version was 22.11.0

Everything went smoothly until I run this line ng new new_project on my terminal. The problem was like the image attached and I didn't know how to fix this problem (although I asked the ChatGPT for clarification).

enter image description here

Do you know how to fix this problem? Thank you so much!


Solution

  • As of me issue happen due to cache.

    npm cache verify
    

    then try:

    npm cache clean --force
    npm install –g @angular/cli@latest 
    ng new <YourProjectName>