How to solve npm "INDEPENDENT INDEPENDENCE"

I am having problems with my package.json file.

It should work fine since I use most node modules in other projects, but I have this package.json below:

 "dependencies": { "@angular/common": "^2.0.0-rc.1", "@angular/compiler": "^2.0.0-rc.1", "@angular/core": "^2.0.0-rc.1", "@angular/platform-browser": "^2.0.0-rc.1", "@angular/platform-browser-dynamic": "^2.0.0-rc.1", "@angular/router": "^2.0.0-rc.1", "angular2-in-memory-web-api": "0.0.7", "bootstrap": "^3.3.6", "es6-shim": "^0.35.0", "reflect-metadata": "^0.1.3", "rxjs": "^5.0.0-beta.6", "systemjs": "^0.19.27", "zone.js": "^0.6.12" }, "devDependencies": { "body-parser": "^1.15.1", "express": "^4.13.4", "jsonwebtoken": "^6.2.0", "mongoose": "^4.4.15" } 

and they should all work fine, since all the dependencies exist, since angular is now in rc.4 and rxjs is on 5.0.0-beta.10.

But I get 3 unsatisfied dependencies on

 npm install ' rxjs@5.0.0-beta.10 ' ' rxjs@5.0.0-beta.6 ' '@angular/ core@2.0.0-rc.1 ' 


I also get these warnings:

 npm WARN @angular/ core@2.0.0-rc.4 requires a peer of rxjs@5.0.0-beta.6 but none was installed. npm WARN @angular/ http@2.0.0-rc.1 requires a peer of rxjs@5.0.0-beta.6 but none was installed. npm WARN @angular/ http@2.0.0-rc.1 requires a peer of @angular/ core@2.0.0-rc.1 but none was installed. 


I also did:

 npm cache clean npm update registry > with the registry link npm update -g 


node is in the latest version and still the same problem ... so just wondering if something is wrong?

+6
source share
1 answer

I think this is because dependency resolution is a little broken, see https://github.com/isaacs/npm/issues/1341#issuecomment-20634338

You may need to manually install top-level modules with unsatisfied dependencies:

npm install findup-sync@0.1.2

Or, structure your .json package so that any top-level modules that are also dependencies of other modules are listed below.

Your problem may also be that npm was unable to load the package, timeout or something else. Sometimes restarting npm install fixes it.

You can also install failed packages manually using npm install

Other steps that may help before trying to install npm again:

Removing node_modules with:

rm -rf node_modules/

then

npm cache clean

To explain why node_modules removal is sometimes required:

Apparently, if the nested module cannot be installed during the npm installation, subsequent installation of npm will not detect those missing nested dependencies. In this case, sometimes it’s enough to remove the top-level dependency on the missing nested modules and run npm again.

See https://github.com/npm/npm/issues/1336

+2
source

All Articles