'ng new' fails
Bug Report
Versions
@angular/cli — 1.4.5
node — 7.2.1
npm — 5.4.2
os — win32 x64 (Windows 10)
Repro Steps
ng new sample-app
The log given by the failure
C:\Development>ng new sample-app
The command "new" has an option without the required type and name fields.
Error: The command "new" has an option without the required type and name fields.
at Class.validateOption (C:\Users\username\AppData\Roaming\npm\node_modules\@angular\cli\ember-cli\lib\models\command.js:377:13)
at Array.map (native)
at Class.registerOptions (C:\Users\username\AppData\Roaming\npm\node_modules\@angular\cli\ember-cli\lib\models\command.js:163:27)
at getOptionsTask.run.then (C:\Users\username\AppData\Roaming\npm\node_modules\@angular\cli\commands\new.js:95:18)
Other details that might be useful
I have used npm to uninstall @angular/cli and reinstall it globally.
Other commands also fail with the same error. For example ng g component some-new-component also throws the error:
The command "generate" has an option without the required type and name fields.
Working for me now too!
Working! Thank You
Is depending on ~0.0.x for devkit (https://github.com/angular/angular-cli/blob/master/package.json#L45) the right move?
Since this means any changes to devkit get rolled out to existing cli versions arbitrarily on the next npm install, I expect this kind of breakage will happen relatively often.
If the cli is depending on 'latest' from upstream packages, having any kind of cli release tags becomes somewhat meaningless.
Working now, thanks.
I still have the same error
i can create project via ng new project-name but can not to generate component but remove folder node_modules and run npm install after working fine with ng
I still not able to get. Same error is coming.
I have a possible solution.
Either upgrade from Node 6 to Node 8 or, downgrade to Angular 1.4.2.
This error happens under: Node 6 with Angular 1.4.3 Node 6 with Angular 1.4.4 Node 6 with Angular 1.4.5
However Node 8 with Angular 1.4.5, works. Node 6 with Angular 1.4.2 works.
Working fine now. Thanks.
I updated to node 8 and it is now working for me.
I'm still getting this error even with Node 8 and by installing 1.4.2 manually from NPM.
Windows 10
Still getting this error as well. Node 8, Angular CLI version 1.4.5.
I have cleared the NPM cache, as well as re installed the CLI globally, and still no luck.
Is there anything outside of the cache and the global installation that could possibly be referencing a bad install of the Angular CLI on my local environment?
me too getting the same error. completely removed the node and verified the package.
This issue has been automatically locked due to inactivity. Please file a new issue if you are encountering a similar or related problem.
Read more about our automatic conversation locking policy.
This action has been performed automatically by a bot.