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

HELP ME Unknown collection "@schematics/angular" When I use ng g compent home

Open richqez opened this issue 9 years ago • 7 comments

Bug Report or Feature Request (mark with an x)

- [x ] bug report -> please search issues before submitting
- [ ] feature request

Versions.


/ \ _ __ __ _ _ | | __ _ _ __ / | | | | / △ \ | ' \ / _ | | | | |/ _ | '| | | | | | | / ___ | | | | (| | || | | (| | | | || | | | // __| ||_, |_,||_,|| _||| |___/ @angular/cli: 1.4.0 node: 7.10.0 os: win32 x64 @angular/animations: 4.3.6 @angular/common: 4.3.6 @angular/compiler: 4.3.6 @angular/core: 4.3.6 @angular/forms: 4.3.6 @angular/http: 4.3.6 @angular/platform-browser: 4.3.6 @angular/platform-browser-dynamic: 4.3.6 @angular/platform-server: 4.3.6 @angular/router: 4.3.6 @angular/upgrade: 4.1.3 @angular/cli: 1.4.0 @angular/compiler-cli: 4.3.6 typescript: 2.3.4

Repro steps.

The log given by the failure.

ng g component r101c --module=eis/eis.module Unknown collection "@schematics/angular". Error: Unknown collection "@schematics/angular". at SchematicEngine.createCollection (C:\PI-Data-Center-App\node_modules@angular-devkit\schematics\src\engine\engine.js:45:19) at Object.getCollection (C:\PI-Data-Center-App\node_modules@angular\cli\utilities\schematics.js:32:31) at Class.run (C:\PI-Data-Center-App\node_modules@angular\cli\tasks\schematic-get-options.js:11:41) at Class.beforeRun (C:\PI-Data-Center-App\node_modules@angular\cli\commands\generate.js:89:31) at Promise.resolve.then (C:\PI-Data-Center-App\node_modules@angular\cli\ember-cli\lib\cli\cli.js:150:24)

richqez avatar Sep 08 '17 09:09 richqez

fix by npm i '@.schematics/angular'

richqez avatar Sep 08 '17 10:09 richqez

npm ERR! code ENOLOCAL npm ERR! Could not install from ".schematics\angular'" as it does not contain a package.json file.

acuntex avatar Sep 08 '17 13:09 acuntex

npm i @schematics/angular

erika9star avatar Sep 08 '17 20:09 erika9star

Did try it without "." yesterday at the time of the post. But it did not work, now it works, thanks 👍

acuntex avatar Sep 09 '17 11:09 acuntex

@erika9star you are a life saver :+1 :)

SherifZekry93 avatar Feb 16 '18 10:02 SherifZekry93

Npm install works too

SherifZekry93 avatar Feb 16 '18 10:02 SherifZekry93

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.