Closed sylnp0201 closed 8 years ago
This should be opened in the react-router repo instead. However, I could not reproduce this.
edvin@rocket-raccoon ~/code mkdir test-shrinkwrap
edvin@rocket-raccoon ~/code cd test-shrinkwrap
edvin@rocket-raccoon ~/code/test-shrinkwrap npm init
....
edvin@rocket-raccoon ~/code/test-shrinkwrap nvm use 0.12
Now using node v0.12.7 (npm v2.11.3)
edvin@rocket-raccoon ~/code/test-shrinkwrap npm -v
2.11.3
edvin@rocket-raccoon ~/code/test-shrinkwrap npm i --save react-router@1.0.0-rc3
react-router@1.0.0-rc3 node_modules/react-router
├── history@1.12.3 (deep-equal@1.0.1, qs@4.0.0)
├── warning@2.1.0 (loose-envify@1.1.0)
└── invariant@2.1.1 (loose-envify@1.1.0)
edvin@rocket-raccoon ~/code/test-shrinkwrap npm shrinkwrap
wrote npm-shrinkwrap.json
@edvinerikson You're right. I'm sorry that I didn't check the error message carefully. The reason I post it here was partially because I ran into another issue with npm shrinkwrap
after I included the redux-router in my project. The problem was the extraneous history. It can be reproduced like this:
$ mkdir test-shrinkwrap
$ cd test-shrinkwrap
$ npm init
...
$ npm i --save redux-router@1.0.0-beta3 --save
$ npm shrinkwrap
npm ERR! Darwin 15.0.0
npm ERR! argv "~/.nvm/versions/node/v0.12.7/bin/node" "~/.nvm/versions/node/v0.12.7/bin/npm" "shrinkwrap"
npm ERR! node v0.12.7
npm ERR! npm v2.11.3
npm ERR! Problems were encountered
npm ERR! Please correct and try again.
npm ERR! extraneous: history@1.9.0 ~/Workspace/test-shrinkwrap/node_modules/redux-router/node_modules/history
...
I managed to reproduce this with your additional information.
However I also managed to solve the problem by running npm prune
.
I'm not sure what causes npm to install the history package, @acdlite do you know what may be causing this?
This seems as expected from npm shrinkwrap
and npm prune
. The former will build based on whatever you have installed locally, including nested devDependencies. That's why you need to run the latter first.
+1, I have the same problem. Isn't the issue here that almost all dependencies of redux-router are specified in devDependencies in its package.json? react, react-router, redux, etc. are certainly ordinary runtime dependencies, e.g. you can't run the app without them, they aren't there just for running the build or running the tests, so shouldn't they be under the ordinary "dependencies" key in package.json? react-router itself has history in its peerDependencies.
But why then in devDependencies, why not at least in the ordinary dependencies?
It's a bug with npm packaging. The PR to fix it just got merged last week; not really a problem with this project and short of annoying workarounds in packaging there's no real way to address it here.
Wait for the next release after the next npm release.
Why this issue is closed? As I understand you in https://github.com/npm/fstream-npm/pull/15#issuecomment-155112062 redux-router needs to be published with a fixed npm version to solve it. I still get the error with 1.0.0-beta4
https://docs.npmjs.com/cli/shrinkwrap
Getting this error when I ran
npm shrinkwrap
:Project environment: