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

ng add @angular/material@latest or ng add @angular/[email protected]

Open j-Cis opened this issue 8 years ago • 7 comments

Bug Report or Feature Request (mark with an x)

- [x] bug report 
- [ ] feature request

Area

- [ ] devkit
- [x] schematics

Versions

  • Node : v10.4.1
  • npm : v6.1.0
  • Angular CLI : 6.1.0-rc.0
  • Microsoft Windows 10 Pro : v10.0.17134 x64

Repro steps

  1. ng new AbcXyz --routing --style=scss --view-encapsulation=Native --prefix=www
  2. ng add @angular/pwa@next
  3. ng add @angular/material@latest or ng add @angular/[email protected]

The log given by the failure

PS C:\A\Cisowscy> ng add @angular/material@latest
Installing packages for tooling via npm.
npm WARN @angular-devkit/[email protected] requires a peer of ng-packagr@^2.2.0 || ^3.0.0 || ^4.0.0-rc.0 but none is installed. You must install peer dependencies yourself.
npm WARN @ngrx/[email protected] requires a peer of @angular/core@^4.0.0 || ^5.0.0 but none is installed. You must install peer dependencies yourself.
npm WARN @ngrx/[email protected] requires a peer of rxjs@^5.0.0 but none is installed. You must install peer dependencies yourself.
npm WARN @ngrx/[email protected] requires a peer of @angular/core@^6.0.0 but none is installed. You must install peer dependencies yourself.
npm WARN @ngrx/[email protected] requires a peer of @angular/core@^6.0.0 but none is installed. You must install peer dependencies yourself.
npm WARN @ngrx/[email protected] requires a peer of @angular/common@^6.0.0 but none is installed. You must install peer dependencies yourself.
npm WARN @ngrx/[email protected] requires a peer of @angular/core@^6.0.0 but none is installed. You must install peer dependencies yourself.
npm WARN @ngrx/[email protected] requires a peer of @angular/router@^6.0.0 but none is installed. You must install peer dependencies yourself.
npm WARN @ngrx/[email protected] requires a peer of @angular-devkit/core@^0.6.0 but none is installed. You must install peer dependencies yourself.
npm WARN @ngrx/[email protected] requires a peer of @angular-devkit/schematics@^0.6.0 but none is installed. You must install peer dependencies yourself.
npm WARN @ngrx/[email protected] requires a peer of @angular/core@^6.0.0 but none is installed. You must install peer dependencies yourself.
npm WARN [email protected] requires a peer of @angular/compiler@>=2.3.1 <7.0.0 || >6.0.0-beta <7.0.0 but none is installed. You must install peer dependencies yourself.
npm WARN [email protected] requires a peer of @angular/core@>=2.3.1 <7.0.0 || >6.0.0-beta <7.0.0 but none is installed. You must install peer dependencies yourself.
npm WARN [email protected] requires a peer of jasmine@>=3 but none is installed. You must install peer dependencies yourself.
npm WARN [email protected] requires a peer of @angular/common@>=5.0.0 but none is installed. You must install peer dependencies yourself.
npm WARN @angular/[email protected] requires a peer of @angular/[email protected] but none is installed. You must install peer dependencies yourself.
npm WARN @angular/[email protected] requires a peer of @angular/core@>=6.0.0-beta.0 <7.0.0 but none is installed. You must install peer dependencies yourself.
npm WARN @angular/[email protected] requires a peer of @angular/common@>=6.0.0-beta.0 <7.0.0 but none is installed. You must install peer dependencies yourself.
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: [email protected] (node_modules\fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for [email protected]: wanted {"os":"darwin","arch":"any"} (current: {"os":"win32","arch":"x64"})

+ @angular/[email protected]
updated 1 package and audited 33279 packages in 96.227s
found 6 vulnerabilities (1 low, 5 moderate)
  run `npm audit fix` to fix them, or `npm audit` for details
Installed packages for tooling via npm.
Collection "@angular/material" cannot be resolved.
Error: Collection "@angular/material" cannot be resolved.
    at NodeModulesEngineHost._resolveCollectionPath (C:\A\Cisowscy\node_modules\@angular-devkit\schematics\tools\node-module-engine-host.js:88:15)
    at NodeModulesEngineHost.createCollectionDescription (C:\A\Cisowscy\node_modules\@angular-devkit\schematics\tools\file-system-engine-host-base.js:106:27)
    at SchematicEngine._createCollectionDescription (C:\A\Cisowscy\node_modules\@angular-devkit\schematics\src\engine\engine.js:147:40)
    at SchematicEngine.createCollection (C:\A\Cisowscy\node_modules\@angular-devkit\schematics\src\engine\engine.js:140:43)
    at Object.getCollection (C:\A\Cisowscy\node_modules\@angular\cli\utilities\schematics.js:35:31)
    at AddCommand.getOptions (C:\A\Cisowscy\node_modules\@angular\cli\models\schematic-command.js:200:41)
    at AddCommand.<anonymous> (C:\A\Cisowscy\node_modules\@angular\cli\commands\add.js:37:49)
    at Generator.next (<anonymous>)
    at C:\A\Cisowscy\node_modules\@angular\cli\commands\add.js:14:71
    at new Promise (<anonymous>)
PS C:\A\Cisowscy>

Desired functionality

Until recently, when the version under @last covered version v6.2.1 everything flashed, flawless!

I do not count on help in this matter because I can do it manually, I only report the error that this is the case.

I warmly greet Angular's team.

j-Cis avatar Jun 19 '18 09:06 j-Cis

Same here:

ng add @angular/material

> ng add @angular/material Installing packages for tooling via npm. Collection "@angular/material" cannot be resolved. Error: Collection "@angular/material" cannot be resolved. at NodeModulesEngineHost._resolveCollectionPath (D:\lib\app\designer\node_modules@angular-devkit\schematics\tools\node-module-engine-host.js:88:15) at NodeModulesEngineHost.createCollectionDescription (D:\lib\app\designer\node_modules@angular-devkit\schematics\tools\file-system-engine-host-base.js:106:27) at SchematicEngine._createCollectionDescription (D:\lib\app\designer\node_modules@angular-devkit\schematics\src\engine\engine.js:78:40) at SchematicEngine.createCollection (D:\lib\app\designer\node_modules@angular-devkit\schematics\src\engine\engine.js:71:43) at Object.getCollection (D:\lib\app\designer\node_modules@angular\cli\utilities\schematics.js:28:31) at AddCommand.getOptions (D:\lib\app\designer\node_modules@angular\cli\models\schematic-command.js:193:41) at AddCommand. (D:\lib\app\designer\node_modules@angular\cli\commands\add.js:30:49) at Generator.next () at D:\lib\app\designer\node_modules@angular\cli\commands\add.js:7:71 at new Promise ()

iwannabebot avatar Jun 19 '18 12:06 iwannabebot

This was also filed over here and it looks like the temp fix is to downgrade to 6.2.1

jaadus avatar Jun 19 '18 17:06 jaadus

Closing as this appears to be an issue with Material, please follow this issue... angular/material2#11836

Brocco avatar Jun 21 '18 13:06 Brocco

Downgrade the angular version to 6.0.0 and use ng add @angular/[email protected]

TharinduRangana avatar Jun 23 '18 13:06 TharinduRangana

i solve my problem with this ng add @angular/[email protected]

llodiaking avatar Jul 01 '18 21:07 llodiaking

@llodiaking & @TharinduRangana : I wrote at the top below of the frame with a buggs that the problem does not appear below 6.3.0, so using an older version of the problem does not give

j-Cis avatar Jul 02 '18 12:07 j-Cis

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.