如何卸载/升级Angular CLI? [英] How to uninstall/upgrade Angular CLI?
问题描述
当我尝试使用 Angular CLI 创建新项目时,使用:
When I try to create a new project with Angular CLI, with:
ng n app
我收到此错误:
fs.js:640返回binding.open(pathModule._makeLong(path), stringToFlags(flags),mode); ^ TypeError:路径必须是字符串或缓冲区 在TypeError(本机)处
fs.js:640 return binding.open(pathModule._makeLong(path), stringToFlags(flags), mode); ^ TypeError: path must be a string or Buffer at TypeError (native)
如何升级或卸载 Angular CLI ?
推荐答案
使用以下命令进行卸载:
Using following commands to uninstall :
npm uninstall -g @angular/cli
npm cache clean --force
要验证: ng --version /*您将收到错误消息,然后您已卸载*/
To verify: ng --version /* You will get the error message, then u have uninstalled */
使用以下命令重新安装:
Using following commands to re-install :
npm install -g @angular/cli
注释:
-使用--force清理所有缓存
-在Windows上,使用管理员运行此文件
-在Mac上,使用 sudo ($ sudo <command>
)
Notes :
- Using --force for clean all the caches
- On Windows run this using administrator
- On Mac use sudo ($ sudo <command>
)
- 如果使用的是
npm>5
,则可能需要使用缓存验证. ($ npm cache verify
)
- If you are using
npm>5
you may need to use cache verify instead. ($ npm cache verify
)
这篇关于如何卸载/升级Angular CLI?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!