Angular 9 ng new stuck at installing packages

萝らか妹 提交于 2021-02-10 06:18:52

问题


I have just installed the node version 12.16.1 the LTS and angular cli version 9.0.3. At the time of creating new project with cli all files in root folder are generating but it is stuck at the part of installing node packages.

Is anybody facing the same issue? Please help how can we resolve it.


回答1:


Every time you create a new project the angular suppose to download huge chunks of file of size around 500mb, all the time that is been taken is actually the time taken to download those file in the background. A good internet connection is the solution.




回答2:


  1. Run command npm i -g npm@latest
  2. Run command npm i -g @angular/cli@latest

It worked for me.




回答3:


I changed directory and then run these command and it worked for me

sudo npm cache clean --force

sudo npm cache verify

sudo npm i npm@latest -g

ng new my-project


Another Solution:

Cancel the installing packages with ctrl+c

and then go to the files of project and run command npm install

This also worked for me



来源:https://stackoverflow.com/questions/60388160/angular-9-ng-new-stuck-at-installing-packages

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!