1 node.js angular-cli angular angular6 angular-cli-v6
C:\dev\myApp> ng serve -o
Your global Angular CLI version (6.0.8) is greater than your local version (1.0.2).
The local Angular CLI version is used.
To disable this warning use `"ng config -g cli.warnings.versionMismatch false"`
Run Code Online (Sandbox Code Playgroud)
我不知道该怎么办。
我尝试卸载angular / cli和npm cache clean, 但是仍然有问题。
有人帮我!
Pie*_*Duc 10
您的package.json中有旧的angular / cli包
要更新使用:
npm r angular-cli
npm i @angular/cli@latest -D
Run Code Online (Sandbox Code Playgroud)
但是请注意,如果您已经使用旧的cli很长时间了,则可能必须进行一些代码迁移。特别是在测试,填充和角度配置文件方面。
您可以尝试使用新的cli创建一个空的角度项目,并将在此创建的文件与您自己项目中的文件进行比较,并在适用时进行更新。
After that, when you have to update your cli again, you can use the new ng update command
您在旧的 CLI 中使用新项目,您需要运行此命令
npm uninstall --save-dev angular-cli
npm install --save-dev @angular/cli@latest
npm install
Run Code Online (Sandbox Code Playgroud)
或者你可以试试这个方法
更新 npm :
Run [sudo] npm install -g npm (sudo is only required on Mac/ Linux)
Run Code Online (Sandbox Code Playgroud)
更新 CLI:
[sudo] npm uninstall -g angular-cli @angular/cli
npm cache clean
[sudo] npm install -g @angular/cli
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
24987 次 |
| 最近记录: |