angular-cli icon indicating copy to clipboard operation
angular-cli copied to clipboard

'ng new' fails

Open theChrisMarsh opened this issue 9 years ago • 34 comments

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.

theChrisMarsh avatar Oct 10 '17 00:10 theChrisMarsh

Working for me now too!

Casebash avatar Oct 10 '17 01:10 Casebash

Working! Thank You

skitto0307 avatar Oct 10 '17 01:10 skitto0307

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.

shadowmint avatar Oct 10 '17 01:10 shadowmint

Working now, thanks.

puppycock avatar Oct 10 '17 02:10 puppycock

I still have the same error

Rmsilva1 avatar Oct 10 '17 02:10 Rmsilva1

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

zinzinday avatar Oct 10 '17 03:10 zinzinday

I still not able to get. Same error is coming.

gsknbabu avatar Oct 10 '17 04:10 gsknbabu

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.

gsknbabu avatar Oct 10 '17 05:10 gsknbabu

I updated to node 8 and it is now working for me.

awsaunier avatar Oct 10 '17 15:10 awsaunier

I'm still getting this error even with Node 8 and by installing 1.4.2 manually from NPM.

Windows 10

leetharris avatar Oct 11 '17 00:10 leetharris

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?

AlexanderEdwards avatar Nov 06 '17 21:11 AlexanderEdwards

me too getting the same error. completely removed the node and verified the package.

ragavanrajan avatar Dec 21 '17 08:12 ragavanrajan

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.