angular-cli: Schematic "ng-new" not found in collection "@schematics/angular".
Versions
Angular CLI: 6.0.1 Node: 8.9.1 npm: 5.5.1
_ _ ____ _ ___
/ \ _ __ __ _ _ _| | __ _ _ __ / ___| | |_ _|
/ △ \ | '_ \ / _` | | | | |/ _` | '__| | | | | | |
/ ___ \| | | | (_| | |_| | | (_| | | | |___| |___ | |
/_/ \_\_| |_|\__, |\__,_|_|\__,_|_| \____|_____|___|
|___/
Angular CLI: 6.0.1
Node: 8.9.1
OS: win32 x64
Angular:
...
Package Version
------------------------------------------------------
@angular-devkit/architect 0.6.1
@angular-devkit/core 0.6.1
@angular-devkit/schematics 0.6.1
@schematics/angular 0.6.1
@schematics/update 0.6.1
rxjs 6.1.0
typescript 2.7.2
Repro steps
- Step 1 Update Angular CLI from version 1.7.6 to 6.0.1 using command “npm install -g @angular/cli”
- Step 2 Use command “ng new my-new-app” to create a new application
- Step 3
Observed behavior
Generates an error:
Schematic “ng-new” not found in collection “@schematics/angular”. Error: Schematic “ng-new” not found in collection “@schematics/angular”. at SchematicEngine.createSchematic (C:\Users\pahal\AppData\Roaming\npm\node_modules@angular\cli\node_modules@angular-devkit\schematics\src\engine\engine.js:155:23) at CollectionImpl.createSchematic (C:\Users\pahal\AppData\Roaming\npm\node_modules@angular\cli\node_modules@angular-devkit\schematics\src\engine\collection.js:12:29) at NodeWorkflow.execute (C:\Users\pahal\AppData\Roaming\npm\node_modules@angular\cli\node_modules@angular-devkit\schematics\tools\workflow\node-workflow.js:69:38) at Promise (C:\Users\pahal\AppData\Roaming\npm\node_modules@angular\cli\models\schematic-command.js:140:22) at new Promise (<anonymous>) at NewCommand.runSchematic (C:\Users\pahal\AppData\Roaming\npm\node_modules@angular\cli\models\schematic-command.js:139:16) at NewCommand.<anonymous> (C:\Users\pahal\AppData\Roaming\npm\node_modules@angular\cli\commands\new.js:77:25) at Generator.next (<anonymous>) at C:\Users\pahal\AppData\Roaming\npm\node_modules@angular\cli\commands\new.js:7:71 at new Promise (<anonymous>)
<!-- Normally this includes a stack trace and some more information. -->
Desired behavior
It should create a new angular application.
Mention any other details that might be useful (optional)
About this issue
- Original URL
- State: closed
- Created 6 years ago
- Reactions: 1
- Comments: 25 (3 by maintainers)
I have this issue too, when upgrade global angular cli to 6.0.1.
I just find out some workaround
Remove the node_modules folder in your home directory.
😸
Don’t delete your global modules! Just :
sudo npm i @schematics/angular
orsudo npm uninstall @schematics/angular
andsudo npm i @schematics/angular
I Have the same problem, @ArthurBrito 's answer solved the issue -
I had this issue and as @banminkyoz said removing the folder node_modules in my home directory solved the problem.
Deleting @angular/cli folder from global folder i.e., %username%/AppData/npm/node_modules/@angular/cli solved the problem @Brocco Can you please tell me how to check angular-config.json, .angular-cli.json, angular.json, .angular.json files in home directory as I cannot find these files anywhere in global folder.