angular / angular-cli

CLI tool for Angular
https://cli.angular.io
MIT License
26.73k stars 11.98k forks source link

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

Closed richqez closed 6 years ago

richqez commented 7 years ago

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 commented 7 years ago

fix by npm i '@.schematics/angular'

acuntex commented 7 years ago

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

erika9star commented 7 years ago

npm i @schematics/angular

acuntex commented 7 years ago

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

SherifZekry93 commented 6 years ago

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

SherifZekry93 commented 6 years ago

Npm install works too

angular-automatic-lock-bot[bot] commented 5 years ago

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.