1
votes

I am working on angular 7 project. I tried to install

 npm install --save @types/underscore

and i get following errors:

npm WARN @agm/[email protected] requires a peer of @angular/common@^5.0.0 || ^6.0.0 but none is installed. You must install peer dependencies yourself. npm WARN @agm/[email protected] requires a peer of @angular/core@^5.0.0 || ^6.0.0 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 @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 @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/[email protected] 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/[email protected] 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/[email protected] 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 @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/[email protected] 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/[email protected] but none is installed. You must install peer dependencies yourself. npm WARN [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/common@^6.0.0 but none is installed. You must install peer dependencies yourself. npm WARN [email protected] requires a peer of @angular/platform-browser@^6.0.0 but none is installed. You must install peer dependencies yourself.

  • @types/[email protected] added 1 package from 5 contributors and audited 40215 packages in 20.546s found 0 vulnerabilities

after it i get this error:

./src/app/services/pager.service.ts
Module not found: Error: Can't resolve 'underscore' in 'e:\xampp\htdocs\testapp\src\app\services

Please help me.

1
@veben i am using this command ng new testapp. It running before i run this command npm install --save @types/underscoreuser10747832
@veben I am using import * as _ from 'underscore'; but i gives an error.user10747832

1 Answers

3
votes

you need to install underscore into dependencies and @types/underscore into devDependencies.

npm i underscore --save
npm i @types/underscore --save-dev

then you can use it.