acdlite / redux-router

Redux bindings for React Router – keep your router state inside your Redux store
MIT License
2.3k stars 200 forks source link

Unmet depedency in redux-router@1.0.0-beta5 / history@1.13.1 #209

Closed tlrobinson closed 8 years ago

tlrobinson commented 8 years ago

I'm not really sure what's going on here, but I'm unable to shrinkwrap a project containing redux-router 1.0.0-beta5 due to this error:

npm ERR! Problems were encountered
npm ERR! Please correct and try again.
npm ERR! missing: invariant@^2.0.0, required by history@1.13.1
npm ERR! missing: qs@^4.0.0, required by history@1.13.1
npm ERR! missing: warning@^2.0.0, required by history@1.13.1

npm ls shows there's an issue with the history dependency:

├─┬ redux-router@1.0.0-beta5
│ ├── deep-equal@1.0.1
│ └─┬ history@1.13.1
│   ├── UNMET DEPENDENCY invariant@^2.0.0
│   ├── UNMET DEPENDENCY qs@^4.0.0
│   └── UNMET DEPENDENCY warning@^2.0.0

I'm on npm v2.14.14.

Scarysize commented 8 years ago

I see, we got a dependency on an older version of history (1.12). You may try updating to npm v3.

tlrobinson commented 8 years ago

A lot of people are still using npm 2. Is there another workaround?

hanjukim commented 8 years ago

+1 people and production servers are still using npm 2.

hanjukim commented 8 years ago

Here's what I found.

history@1.13.1 is included in redux-router@1.0.0-beta5 npm package inside. I think history module should be installed by npm install, not from the package. You can find out by uncompressing cache file from ~/.npm/redux-router/1.0.0-beta5/package.tgz once after install.

lukekarrys commented 8 years ago

I think this might be the same issue I ran into previously here: https://github.com/rackt/redux-router/issues/54 which ended up being an npm issue https://github.com/npm/npm/issues/9642.

The issue I think is that the bug is still present in npm3. This is a problem because this happens when this package is published by npm3 since npm is including node_modules/history in the tarball, so it doesn't matter if you are consuming it using npm2.

I've been using a workaround where I just rimraf node_modules/redux-router/history since its not needed, but I'm not sure if that will work when shrinkwrapping (all I'm doing is running npm ls to validate that my package.json and node_modules are in sync).

Scarysize commented 8 years ago

So basically we got either people having problems with shrink-wrap (if history is just a devDependency) or people having problems with older npm versions (if history is a dependency).

Any advice to satisfy both needs is welcome! I don't have an immediate solution and also that really not the time to test for different npm versions.

hanjukim commented 8 years ago

Until NPM fixes bug, we can make publish script like

rimraf node_modules/history; npm publish; npm install

Ugly and disappointing...

Scarysize commented 8 years ago

We are in the process of eliminating history as a dependency. On a side note: the npm bug with the history module is fixed.