[英]'ng new my-app' error
I am trying to generate a new project and skeleton application using the latest version of Angular. 我正在尝试使用最新版本的Angular生成一个新项目和框架应用程序。 I have tried uninstalling and reinstalling Angular CLI using: 我尝试使用以下方法卸载和重新安装Angular CLI:
C:\>npm install -g @angular/cli@latest
C:\>ng --version
@angular/cli: 1.4.5
node: 8.8.1
os: win32 x64
This error occurs when trying to run 'ng new my-app' in command prompt: 尝试在命令提示符下运行“ ng new my-app”时发生此错误:
'Error: The command "new" has an option without the required type and name field'
Any help to resolve this issue is appreciated. 感谢您为解决此问题提供的任何帮助。
This is a known issue and there is an issue raised in github for this. 这是一个已知问题,因此在github中提出了一个问题。
https://github.com/angular/angular-cli/issues/7984 https://github.com/angular/angular-cli/issues/7984
Try below commands: 请尝试以下命令:
npm uninstall -g @angular/cli
npm cache clean
npm install -g @angular/cli@latest
After these steps: 这些步骤之后:
npm uninstall -g @angular/cli
npm cache clean
npm install -g @angular/cli@latest
Do: 做:
npm install @schematics/angular
And then: 接着:
ng new appname
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.