ng new not working @6.0.0
Versions
NPM 5.6.0 Angular CLI: 6.0.0 Node: 10.0.0 OS: win32 x64 Angular: ... Package Version angular-devkit/architect 0.6.0 angular-devkit/core 0.6.0 angular-devkit/schematics 0.6.0 schematics/angular 0.6.0 schematics/update 0.6.0 rxjs 6.1.0 typescript 2.7.2
Repro steps
ng new ng-app
Observed behavior
Commande output:
Schematic "ng-new" not found in collection "@schematics/angular".
Error: Schematic "ng-new" not found in collection "@schematics/angular".
at SchematicEngine.createSchematic (C:\Users\User\AppData\Roaming\npm\node_modules\@angular\cli\node_modules\@angular-devkit\schematics\src\engine\engine.js:155:23)
at CollectionImpl.createSchematic (C:\Users\User\AppData\Roaming\npm\node_modules\@angular\cli\node_modules\@angular-devkit\schematics\src\engine\collection.js:12:29)
at NodeWorkflow.execute (C:\Users\User\AppData\Roaming\npm\node_modules\@angular\cli\node_modules\@angular-devkit\schematics\tools\workflow\node-workflow.js:70:38)
at Promise (C:\Users\User\AppData\Roaming\npm\node_modules\@angular\cli\models\schematic-command.js:141:22)
at new Promise (<anonymous>)
at NewCommand.runSchematic (C:\Users\User\AppData\Roaming\npm\node_modules\@angular\cli\models\schematic-command.js:140:16)
at NewCommand.<anonymous> (C:\Users\User\AppData\Roaming\npm\node_modules\@angular\cli\commands\new.js:77:25)
at Generator.next (<anonymous>)
at C:\Users\User\AppData\Roaming\npm\node_modules\@angular\cli\commands\new.js:7:71
at new Promise (<anonymous>)
Desired behavior
Should generate angular app
Your install must be broken. It works fine for me.
@larssn do you have the same npm and node versions?
same problem for me
I have exactly the same versions yes.
I reinstalled node v10.0.0 but I have the same error still. now installed node v8.11.1 and still I have the same problem.
@larssn are you on Windows x64?
npm install -g npm npm uninstall -g angular-cli npm cache clean npm install -g @angular/cli@lates
@tonmanayo I tried your instructions, that doesn't solve the problem for me.
I tested in another machine with the same environment and it works!
But I don't know why it still doesn't work in the first machine. I tried uninstalling npm, deleting the npm and npm-cache folders from \AppData\Roaming\, and installing again with no success.
Any thoughts on what could cause the problem?
Could you provide the output of both the following commands?
npm ls -g @schematics/angular
npm ls @schematics/angular
@clydin This is the output:
> npm ls -g @schematics/angular
C:\Users\User\AppData\Roaming\npm
`-- @angular/[email protected]
`-- @schematics/[email protected]
> npm ls @schematics/angular
C:\Users\User
+-- @angular/[email protected]
| `-- @schematics/[email protected] extraneous
`-- @schematics/[email protected]
npm ERR! extraneous: @schematics/[email protected] C:\Users\User\node_modules\@angular\cli\node_modules\@schematics\angular
From the output from the second command it appears that there is a node_modules folder (and potentially package.json) with both the CLI and an old version of @schematics/angular installed locally (C:\Users\User). This is most likely the source of the problem and under typical scenarios should not be present.
@clydin You are right, there is a node_modules folder in C:\Users\User\, and removing the folder solved the problem.
Thank you, and sorry for the trouble.
No problem. I'm glad you got it sorted out.
Awesome man its working fine. Spend hell lot of time to identify the issue but this is really nice.
Thank you so much @clydin
Hi!
I have the same problem. I don´t understand which folder exactly is to delete?!?! Simply deleting the whole node_module folder under /user/my_username/ doesn´t solve the problem. I can generate a new app but this consists only of the @angular/cli and all other packages are missing.
npm install -g npm npm uninstall -g @angular/cli npm uninstall @angular/cli npm cache clean --force npm install -g @angular/cli@latest
check if it's work otherwise just update two more packages
npm i -g @schematics/angular npm i -g @schematics/angular
npm i @schematics/angular npm i @schematics/angular
This will force to update both local and global package.json file to use all the dependencies of angular 6
Hope this will work, This approach had worked in my mac
npm install g @angular/cli the command global installation create the problem in acessing the c drive so installing tha angular cli in the project folder will not cause ant warning or error

same problem for me npm install g @angular/cli the command global installation create the problem in acessing the c drive so installing tha angular cli in the project folder will not cause ant warning or error
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.
