Lij*_*raj 5 angular-cli angular
我刚刚开始使用CLI,当我尝试安装@ angular/cli并运行代码时 ng --help
我收到以下错误
'ng'不被识别为内部或外部命令,
我已经浏览了所有博客,并且在按照博客中列出的所有步骤后没有找到任何帮助
用户变量路径:; C:\ Program Files \nodejs \和系统变量:C:\ Program Files \nodejs \;%AppData%\npm ;;
当我运行命令
npm install -g @ angular/cli
我在node_modules文件夹下找到了以下文件
@angular
-cli
---斌
----- NG
CLI
我试图使用清理缓存
npm cache clean
Run Code Online (Sandbox Code Playgroud)
然后运行代码
ng --version
Run Code Online (Sandbox Code Playgroud)
但我收到标题中提到的错误
小智 20
我搜索了很久但没有找到解决方案.您必须遵循以下步骤:
AS之后
npm install -g @angular/cli@latest
这条道路显得像
C:\ Users \用户rizwan.local \共享\ NPM
复制路径并将其粘贴到环境变量中
保存并运行 ng -v
请享用
angular-cli 是旧版本,新版本优先
npm uninstall -g angular-cli
npm uninstall --save-dev angular-cli
Run Code Online (Sandbox Code Playgroud)
安装新版本
npm uninstall -g @angular/cli
npm cache clean
npm install -g @angular/cli@latest
Run Code Online (Sandbox Code Playgroud)
我认为你的包名是错误的。
根据 github 页面:
https://github.com/angular/angular-cli
你应该使用这个命令:
npm install -g @angular/cli
我认为angular-cli是旧版本。
| 归档时间: |
|
| 查看次数: |
22253 次 |
| 最近记录: |