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

Schematic "ng-new" not found in collection "@schematics/angular".

Open npahalZenways opened this issue 8 years ago • 25 comments

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 () at NewCommand.runSchematic (C:\Users\pahal\AppData\Roaming\npm\node_modules@angular\cli\models\schematic-command.js:139:16) at NewCommand. (C:\Users\pahal\AppData\Roaming\npm\node_modules@angular\cli\commands\new.js:77:25) at Generator.next () at C:\Users\pahal\AppData\Roaming\npm\node_modules@angular\cli\commands\new.js:7:71 at new Promise ()

<!-- 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)

npahalZenways avatar May 15 '18 06:05 npahalZenways

I Have the same problem, @ArthurBrito 's answer solved the issue -

  1. npm uninstall @schematics/angular
  2. npm i @schematics/angular

OfirTheOne avatar Aug 31 '18 15:08 OfirTheOne

Thanks OfirTheOne, this solution worked for me.

kayush123 avatar Nov 24 '18 09:11 kayush123

npm i @schematics/angular

Rits1701 avatar Dec 27 '18 16:12 Rits1701

Thanks for reporting this issue. This issue is now obsolete due to changes in the recent releases. Please update to the most recent Angular CLI version.

If the problem persists after upgrading, please open a new issue, provide a simple repository reproducing the problem, and describe the difference between the expected and current behavior.

alan-agius4 avatar Aug 15 '19 17:08 alan-agius4

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.