![](/img/trans.png)
[英]ng serve command not working after updating to the latest Angular CLI
[英]cli command ng new not working for angular 7
剛剛將我的 cli、npm、ng 和 nodejs 更新到最新版本。 ng v
給出了這個:
Angular CLI: 7.0.2
Node: 8.12.0
OS: darwin x64
Angular:
...
Package Version
------------------------------------------------------
@angular-devkit/architect 0.10.2
@angular-devkit/core 7.0.2
@angular-devkit/schematics 7.0.2
@schematics/angular 7.0.2
@schematics/update 0.10.2
rxjs 6.3.3
typescript 3.1.3
也成功更新舊的 Angular 6 項目。 但是,在發出命令ng new myproj
,我得到了結果:
Schematic input does not validate against the Schema: {"name":"myproj"}
Errors:
Data path "" should have required property 'version'.
這個問題太新鮮了,沒有在線修復方法。 有什么幫助嗎?
我有類似的問題。我嚴格嘗試了以下步驟:
Uninstall angular cli(npm uninstall -g @angular/cli)
Uninstall node.js from control panel/add or remove software option of your computer
->從計算機手動刪除 npm 和 npm-cache 文件夾(這些文件夾在 C:\\Users\\asus\\AppData\\Roaming 中,在您的情況下,“用戶”可能是您的姓名,“華碩”可能是您的計算機制造商名稱)
->重新安裝最新的node.js版本(安裝時選擇“npm as package manager”選項)
Run the command "npm i -g npm@latest" at powershell/gitbash
->重啟電腦
Run "npm install -g @angular/cli" command
Run "ng config -g cli.packageManager npm" command
Run "npm cache verify" command(or npm cache clean --force if node version < 5)
一切正常。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.