如何卸载/升级 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 return binding.open(pathModule._makeLong(path),stringToFlags(flags), mode);^ 类型错误:路径必须是字符串或缓冲区在 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?
推荐答案
使用以下命令卸载:
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
)
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屋!