Angular package.json and unmet peer dependencies

I am trying to develop an angular project and I am using CLI. I am also trying to use some other components like angular handsontable and primeng . However, I figured out a huge ball for me when I just wanted to see which versions of some packages, including angular, I installed.

So, for example, if I want to check the installed version of primeng, I saw that I can do "npm list primeng". I get the following:

C:\Code\path-to-my-project>npm list primeng
+-- UNMET PEER DEPENDENCY @angular/common@4.1.3
+-- UNMET PEER DEPENDENCY @angular/compiler@4.1.3
+-- UNMET PEER DEPENDENCY @angular/core@4.1.3
+-- UNMET PEER DEPENDENCY @angular/forms@4.1.3
`-- primeng@4.0.3

npm ERR! peer dep missing: @angular/common@^2.3.1, required by ng2-handsontable@0.48.0
npm ERR! peer dep missing: @angular/compiler@^2.3.1, required by ng2-handsontable@0.48.0
npm ERR! peer dep missing: @angular/core@^2.3.1, required by ng2-handsontable@0.48.0
npm ERR! peer dep missing: @angular/forms@^2.3.1, required by ng2-handsontable@0.48.0

      

Ok so ... does this mean angular / generic, compiler, core and forms are not installed? This is weird since angular works. Let me check ...

C:\Code\path-to-my-project>npm list @angular/common
+-- UNMET PEER DEPENDENCY @angular/common@4.1.3
+-- UNMET PEER DEPENDENCY @angular/compiler@4.1.3
+-- UNMET PEER DEPENDENCY @angular/core@4.1.3
`-- UNMET PEER DEPENDENCY @angular/forms@4.1.3

npm ERR! peer dep missing: @angular/common@^2.3.1, required by ng2-handsontable@0.48.0
npm ERR! peer dep missing: @angular/compiler@^2.3.1, required by ng2-handsontable@0.48.0
npm ERR! peer dep missing: @angular/core@^2.3.1, required by ng2-handsontable@0.48.0
npm ERR! peer dep missing: @angular/forms@^2.3.1, required by ng2-handsontable@0.48.0
npm ERR! code 1

      

It looks like this is not what I can say. But this is the dependencies section of my package.json:

"dependencies": {
    "@angular/animations": "^4.1.2",
    "@angular/common": "^4.1.3",
    "@angular/compiler": "^4.1.3",
    "@angular/core": "^4.1.3",
    "@angular/forms": "^4.1.3",
    "@angular/http": "^4.0.0",
    "@angular/platform-browser": "^4.0.0",
    "@angular/platform-browser-dynamic": "^4.0.0",
    "@angular/router": "^4.0.0",
    "core-js": "^2.4.1",
    "font-awesome": "^4.7.0",
    "ng2-handsontable": "^0.48.0",
    "primeng": "^4.0.0",
    "rxjs": "^5.1.0",
    "zone.js": "^0.8.4"
  },

      

and I've done "npm install" in this directory many times. And angular works ...

So what's going on? I would think that with all these @ angular lines in my .json package, when I install npm, it installs those packages.

+3


source to share


1 answer


I solved the same problem after following the instructions below!



    npm install npm -g
    npm install --save-dev @angular/cli@latest
    npm install
    npm start

      

0


source







All Articles