ng add @angular/material An unhandled exception occurred: npm WARN deprecated request@2.88.2:

33 views
Skip to first unread message

Marc B

unread,
Mar 9, 2020, 12:14:38 PM3/9/20
to angular-material2
When I run ng add @angular/material I get 

"Installing packages for tooling via npm."

and then

"An unhandled exception occurred: npm WARN deprecated req...@2.88.2: request has been deprecated, see https://github.com/request/request/issues/3142
npm ERR! Unexpected end of JSON input while parsing near '...nyc":"^11.4.1","sinon'"

I yarn-upgraded angular-cli, yarn-upgraded npm but still get the error.

I try to add angular material to an existing application"@angular/core""~8.2.9".

What is the problem here??

Marc B

unread,
Mar 9, 2020, 12:56:13 PM3/9/20
to angular-material2
ok, I get my steps from https://material.angular.io/guide/getting-started. Although not mentioned I figured out I have to do "yarn add @angular/material" first, _Then_ do ng add @angular/material.

I get the questions from the schematic runner then the updating of my package.json starts.Buuuut I still get the error. Full output below:

yarn add @angular/material @angular/cdk @angular/animations
yarn add v1.22.0
warning package-lock.json found. Your project contains lock files generated by tools other than Yarn. It is advised not to mix package managers in order to avoid resolution inconsistencies caused by unsynchronized lock files. To clear this warning, remove package-lock.json.
[1/4] Resolving packages...
[2/4] Fetching packages...
info fsev...@2.1.2: The platform "win32" is incompatible with this module.
info "fsev...@2.1.2" is an optional dependency and failed compatibility check. Excluding it from installation.      
info fsev...@1.2.11: The platform "win32" is incompatible with this module.
info "fsev...@1.2.11" is an optional dependency and failed compatibility check. Excluding it from installation.     
[3/4] Linking dependencies...
warning " > karma-jasmine...@1.5.2" has incorrect peer dependency "jasmine-core@>=3.5".
warning " > @angular/mate...@9.1.1" has incorrect peer dependency "@angular/core@^9.0.0 || ^10.0.0-0".
warning " > @angular/mate...@9.1.1" has incorrect peer dependency "@angular/forms@^9.0.0 || ^10.0.0-0".
warning " > @angular/c...@9.1.1" has incorrect peer dependency "@angular/core@^9.0.0 || ^10.0.0-0".
warning " > @angular/c...@9.1.1" has incorrect peer dependency "@angular/common@^9.0.0 || ^10.0.0-0".
warning " > @angular/anima...@9.0.5" has incorrect peer dependency "@angular/co...@9.0.5".
[4/4] Building fresh packages...
success Saved lockfile.
success Saved 3 new dependencies.
info Direct dependencies
├─ @angular/anima...@9.0.5
├─ @angular/c...@9.1.1
└─ @angular/mate...@9.1.1
info All dependencies
├─ @angular/anima...@9.0.5
├─ @angular/c...@9.1.1
└─ @angular/mate...@9.1.1
Done in 13.92s.
PS E:\www\ifactuur-v3> ng add @angular/material
Skipping installation: Package already installed
? Choose a prebuilt theme name, or "custom" for a custom theme: Indigo/Pink        [ Preview: https://material.angular.io?theme=indigo-pink ]
? Set up global Angular Material typography styles? Yes
? Set up browser animations for Angular Material? Yes
UPDATE package.json (1450 bytes)
npm ERR! Unexpected end of JSON input while parsing near '...nyc":"^11.4.1","sinon'

npm ERR! A complete log of this run can be found in:
npm ERR!     C:\Users\Marc\AppData\Roaming\npm-cache\_logs\2020-03-09T16_49_54_119Z-debug.log
Package install failed, see above.
Reply all
Reply to author
Forward
0 new messages