I am trying to generate a new project and skeleton application using the latest version of Angular. I have tried uninstalling and reinstalling Angular CLI using:
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:
'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.
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
imran zafar
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
来源:https://stackoverflow.com/questions/47020670/ng-new-my-app-error