Roh*_*ant 72 angular-cli angular
我安装了Angular-CLI,但它显示错误.当我创建一个新项目时__CODE__,我收到此错误:
ng n app
Run Code Online (Sandbox Code Playgroud)
所以我想卸载Angular-CLI.
小智 200
使用以下命令:
npm uninstall -g @angular/cli
npm cache clean --force
Run Code Online (Sandbox Code Playgroud)
备注:
在Mac上使用sudo($ sudo <command>)
如果您正在使用npm>5,则可能需要使用缓存验证.($ npm cache verify)
Van*_*ert 22
以上解决方案都不适用于我.在Windows 7上,这有效:
安装Rapid Environment Editor并删除节点的所有条目,npm, angular-cli or @angular/cli
卸载node.js并重新安装.再次运行Rapid Environment Editor并确保node.js和npm位于您的系统或用户路径中.卸载任何现有的ng版本:
npm uninstall -g angular-cli
npm uninstall -g @angular/cli
npm cache clean
Run Code Online (Sandbox Code Playgroud)
删除C:\Users\YOU\AppData\Roaming\npm\node_modules\@angular文件夹.
然后,重新启动,最后运行:
npm install -g @angular/cli
Run Code Online (Sandbox Code Playgroud)
然后屏住呼吸并运行ng -v.如果你很幸运,你会得到一些爱.因此每次运行ng命令时都要屏住呼吸,因为在"运行正常"之后,"命令未找到"已经多次为我重新出现,我认为问题已经解决了.
veb*_*ben 13
常规解决方案,并不总是有效:
npm uninstall -g @angular/cli
npm cache verify
npm install -g @angular/cli
Run Code Online (Sandbox Code Playgroud)
其他更彻底的解决方案:
Angular CLI全局卸载npm uninstall -g @angular/cli
Run Code Online (Sandbox Code Playgroud)
Node.js并npm使用卸载程序Node.js删除与&相关的所有环境变量npmC:\Users\<user>\AppData\Roaming\npm和C:\Users\<user>\AppData\Roaming\npm-cacheng version
npm -v
node -v
Run Code Online (Sandbox Code Playgroud)
Node.js并npm使用安装程序: https: //nodejs.org/en/download/ Angular CLInpm install -g @angular/cli
Run Code Online (Sandbox Code Playgroud)
ng version
Run Code Online (Sandbox Code Playgroud)
Sta*_*ley 11
运行以下命令以获取最新的角度
npm uninstall -g @angular/cli
npm cache verify
npm install -g @angular/cli@latest
npm install
Run Code Online (Sandbox Code Playgroud)
Angular cli 已移至@angular/cli,因此来自 github 自述文件,
sudo npm uninstall -g @angular/cli
npm cache clean
Run Code Online (Sandbox Code Playgroud)
我尝试了上述所有方法,但仍然无法在全球范围内停留。所以在 powershell 中我运行了Get-Command ng,然后就清楚了我的问题是什么。我过去大量使用yarn,所有旧的Angular cli 包也全局安装在yarn 缓存位置。为了更好的衡量,我删除了我的纱线缓存,但可能只是通过纱线更新了全局角度 cli。无论如何,我希望这有助于提醒你们中的一些人,如果您使用yarn,那么像 ng 这样的全局命令也可以位于 npm 放置它们的另一个路径中。
| 归档时间: |
|
| 查看次数: |
308358 次 |
| 最近记录: |