npm unable to revert to previous version of node package (angular-cli)

雨燕双飞 提交于 2019-12-24 07:36:25

问题


The current version of the node package angular-cli has a few bugs, so I want to revert to a previous verison: 1.0.0-beta.28.3.

The question is what steps do I need to do to revert to a previous version of a node package.

I run:

npm uninstall angular-cli --save -g 

npm cache clean angular-cli

npm i --save -g angular-cli@1.0.0-beta.21

After doing this, I reinstall and have tried opening a new git console. However, ng --version still returns: version 1.0.0-beta.28.3


回答1:


If you're using Angular CLI beta.28 or less, you need to uninstall angular-cli package. It should be done due to changing of package's name and scope from angular-cli to @angular/cli:

npm uninstall -g angular-cli
npm uninstall --save-dev angular-cli

then clean the cacge and install the new version

npm cache clean
npm i --save -g angular-cli@1.0.0-beta.21


来源:https://stackoverflow.com/questions/42830647/npm-unable-to-revert-to-previous-version-of-node-package-angular-cli

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