'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.
Getting this too. On a fresh install of node/npm.
@angular/cli — 1.4.5
node — 6.11.4
npm — 3.10.10
os — Windows 10 x64
I have the same problem after uninstalling and reinstalling to the latest version using npm.
stdout@desktop-94847:/data/nodejs/angular4$ ng generate component my-new-component
The command "generate" has an option without the required type and name fields.
Error: The command "generate" has an option without the required type and name fields.
at Class.validateOption (/data/nodejs/angular4/node_modules/@angular/cli/ember-cli/lib/models/command.js:377:13)
at Array.map (<anonymous>)
at Class.registerOptions (/data/nodejs/angular4/node_modules/@angular/cli/ember-cli/lib/models/command.js:163:27)
at getOptionsTask.run.then (/data/nodejs/angular4/node_modules/@angular/cli/commands/generate.js:98:18)
at <anonymous>
I have the same problem
I am having the same problem
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 (/node_modules/@angular/cli/ember-cli/lib/models/command.js:377:13) at Array.map (native) at Class.registerOptions (/node_modules/@angular/cli/ember-cli/lib/models/command.js:163:27) at getOptionsTask.run.then (/node_modules/@angular/cli/commands/new.js:95:18)
I have the same problem
@angular/cli: 1.4.5 node: 6.11.4 os: win32 x64 npm: 5.4.2
The command "new" has an option without the required type and name fields. The command "generate" 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 (/node_modules/@angular/cli/ember-cli/lib/models/command.js:377:13) at Array.map (native) at Class.registerOptions (/node_modules/@angular/cli/ember-cli/lib/models/command.js:163:27) at getOptionsTask.run.then (/node_modules/@angular/cli/commands/new.js:95:18)
Same here with new:
@angular/cli — 1.4.5
node — 8.6.0
npm — 5.3.0
os — MacOS Sierra (10.12.6)
20:44 $ ng new static
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 (/Users/jameskbride/.config/yarn/global/node_modules/@angular/cli/ember-cli/lib/models/command.js:377:13)
at Array.map (<anonymous>)
at Class.registerOptions (/Users/jameskbride/.config/yarn/global/node_modules/@angular/cli/ember-cli/lib/models/command.js:163:27)
at getOptionsTask.run.then (/Users/jameskbride/.config/yarn/global/node_modules/@angular/cli/commands/new.js:95:18)
at <anonymous>
Getting the same error on a fresh installation.
@angular/cli: 1.4.5
node: 6.11.3
os: win32 x64
C:\Dropbox\Nodejs>ng new Angular
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\TRABAJO\AppData\Roaming\npm\node_modules\@angular\cli\ember-cli\lib\models\command.js:377:13)
at Array.map (native)
at Class.registerOptions (C:\Users\TRABAJO\AppData\Roaming\npm\node_modules\@angular\cli\ember-cli\lib\models\command.js:163:27)
at getOptionsTask.run.then (C:\Users\TRABAJO\AppData\Roaming\npm\node_modules\@angular\cli\commands\new.js:95:18)
I am also experiencing the issue. Freshly installed CLI.
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 (/usr/local/lib/node_modules/@angular/cli/ember-cli/lib/models/command.js:377:13)
at Array.map (<anonymous>)
at Class.registerOptions (/usr/local/lib/node_modules/@angular/cli/ember-cli/lib/models/command.js:163:27)
at getOptionsTask.run.then (/usr/local/lib/node_modules/@angular/cli/commands/new.js:95:18)
at <anonymous>
Edit: This applied to
ng generate
as well
Installed the CLI and then got this error when trying to generate a new component:
The command "generate" has an option without the required type and name fields. Error: The command "generate" has an option without the required type and name fields.
I have the same issue. I installed Angular for the first time this evening on this Macbook Pro:
@angular/cli - 1.4.5 node - 8.6.0 npm - 5.3.0 OS - MacOS Sierra 10.12.6
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 (/usr/local/lib/node_modules/@angular/cli/ember-cli/lib/models/command.js:377:13)
at Array.map (<anonymous>)
at Class.registerOptions (/usr/local/lib/node_modules/@angular/cli/ember-cli/lib/models/command.js:163:27)
at getOptionsTask.run.then (/usr/local/lib/node_modules/@angular/cli/commands/new.js:95:18)
at <anonymous>
I have the same problem
@angular/cli - 8.6.0 node - 1.4.5 npm - 5.3.0 OS - MacOS High Sierra 10.13
Error: The command "new" has an option without the required type and name fields.
at Class.validateOption (/Users/chris/.nvm/versions/node/v8.6.0/lib/node_modules/@angular/cli/ember-cli/lib/models/command.js:377:13)
at Array.map (
I have the same problem as well
node - v6.11.4 npm - 3.10.10 @angular/cli - 1.4.5 os - win32 x64
ng new testdemo
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\shmoorth\AppData\Roaming\npm\node_modules@angular\cli\ember-cli\lib\models\command.js:377:13) at Array.map (native) at Class.registerOptions (C:\Users\shmoorth\AppData\Roaming\npm\node_modules@angular\cli\ember-cli\lib\models\command.js:163:27) at getOptionsTask.run.then (C:\Users\shmoorth\AppData\Roaming\npm\node_modules@angular\cli\commands\new.js:95:18)
Same I have the same problem. I had to install 1.3.2 to be able to use the command "ng new [appname]" again.
@angular/cli: 1.4.5 node: 6.11.4 os: win32 x64 npm: 5.4.2
Just spoke with @hansl - he reverted the last commit to https://github.com/angular/devkit. I just tested after reinstalling the CLI and everything is back to working.
Yup. worked for me now. Thanks @delasteve and @hansl
@delasteve Uninstalled @angular/cli and reinstalled (on the assumption that devkit has been updated). Back in business now. Thanks!
the problem was solved!
now run
npm uninstall -g @angular/cli
npm cache clean
if npm version is > 5 then use npm cache verify to avoid errors (or to avoid using --force)
npm install -g @angular/cli@latest
@delasteve all working now! Cheers ::))
Fixed by reverting the faulty PR. We'll need to be more careful when untangling the Schematics from the CLI. Closing this as fixed.
Working fine for me now. Thank you @delasteve and @hansl