[英]cli command ng new not working for angular 7
Just updated my cli, npm, ng and nodejs to latest versions.刚刚将我的 cli、npm、ng 和 nodejs 更新到最新版本。 An
ng v
gives this: 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
Update old Angular 6 projects successfully also.也成功更新旧的 Angular 6 项目。 However, upon issuing the command
ng new myproj
, I get the result:但是,在发出命令
ng new myproj
,我得到了结果:
Schematic input does not validate against the Schema: {"name":"myproj"}
Errors:
Data path "" should have required property 'version'.
The issue is so fresh there isn't how-to-fix online.这个问题太新鲜了,没有在线修复方法。 Any help?
有什么帮助吗?
I have had similar sort of issue.I tried the following steps strictly:我有类似的问题。我严格尝试了以下步骤:
Uninstall angular cli(npm uninstall -g @angular/cli)
Uninstall node.js from control panel/add or remove software option of your computer
->Delete npm and npm-cache folder manually from computer(These folders are in C:\\Users\\asus\\AppData\\Roaming,in your case 'Users' maybe your name and 'asus' maybe your computer manufacturers name) ->从计算机手动删除 npm 和 npm-cache 文件夹(这些文件夹在 C:\\Users\\asus\\AppData\\Roaming 中,在您的情况下,“用户”可能是您的姓名,“华硕”可能是您的计算机制造商名称)
->Re-install latest node.js version(select the option "npm as package manager" wile installing) ->重新安装最新的node.js版本(安装时选择“npm as package manager”选项)
Run the command "npm i -g npm@latest" at powershell/gitbash
->Restart computer ->重启电脑
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)
Everything worked.一切正常。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.