Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

react-router wants history@1.13.x #2682

Closed
curiouslychase opened this issue Dec 9, 2015 · 21 comments
Closed

react-router wants history@1.13.x #2682

curiouslychase opened this issue Dec 9, 2015 · 21 comments

Comments

@curiouslychase
Copy link

Just wanted to document it here, we can close it but if someone searches for the issue, maybe it'll help. If you get an error like this on npm install and you have history as a dependency in your project root:

npm ERR! peerinvalid Peer react-router@1.0.2 wants history@1.13.x`

Recommended course of action (for now?) is to change dependencies in package.json:

"dependencies": {
  "react-router": "1.0.2",
  "history": "1.13.x"
}

cc @mjackson @ryanflorence

@mjackson
Copy link
Member

mjackson commented Dec 9, 2015

Thanks, @chaseadamsio.

Yes, this workaround is only for right now. We thought that it would be an ok solution to just do a patch release of RR that doesn't show all warnings from the deprecations in the history package, and in a clean npm install it works well. In fact, people who are still using npm 2 will even get that peer dep automatically.

What we didn't think about is that people who already had history@1.15 installed would have to intentionally downgrade to get the warnings to go away.

@ryanflorence is working on a blog post right now to help people understand what we're thinking we'll do from here on out, but it basically boils down to:

  • bump major version numbers when we deprecate stuff
  • establish a regular release cycle to give people time to upgrade

I'll link to the blog post once he posts.

@mjackson mjackson closed this as completed Dec 9, 2015
@BerkeleyTrue
Copy link

Yup, travis stopped working for us because of this and we had to downgrade our dep on history module to fix it.

@taion
Copy link
Contributor

taion commented Dec 9, 2015

@mjackson What do you think of pushing out an interim history release that just drops the depreciation warnings? It might be the easiest all around.

@mjackson
Copy link
Member

mjackson commented Dec 9, 2015

I think the current workaround is fine. We've documented it and told everyone about it. Next major release will be better.

@mjackson
Copy link
Member

mjackson commented Dec 9, 2015

@BerkeleyTrue Why did your CI break?

@mike-engel
Copy link

@mjackson my travis build has also broke (without the workaround). https://travis-ci.org/mike-engel/bkmrkd/jobs/95724906, with my package.json here: https://github.com/mike-engel/bkmrkd/blob/redux-tests-43/package.json#L45

mike-engel added a commit to mike-engel/bkmrkd that referenced this issue Dec 9, 2015
@geminiyellow
Copy link

oops, me too

npm WARN react-router@1.0.2 requires a peer of history@1.13.x but none was installed.

@mjackson
Copy link
Member

mjackson commented Dec 9, 2015

@mike-engel The key lines from your Travis log are:

npm ERR! peerinvalid The package history@1.15.0 does not satisfy its siblings' peerDependencies requirements!
npm ERR! peerinvalid Peer react-router@1.0.2 wants history@1.13.x

But it's strange that you had history 1.15 installed when you specified 1.13 in your package.json... was it cached from a previous npm install?

@mike-engel
Copy link

@mjackson It was trying to install 1.15, because it matched the semver tag for ^1.13.1, which is how npm adds packages to package.json by default. More info

So, while I specified (and most people will this way if they run npm install history@1.13.x), and it got added as ^1.13.1, 1.15.0 was treated as compatible by semver with the caret prefix.

@BerkeleyTrue
Copy link

@mjackson Same story here. We had history: ^1.9.0 in our package.json. npm installs 1.15 and then tries to install react-router which breaks the install.

@mjackson
Copy link
Member

mjackson commented Dec 9, 2015

Great, thanks for letting us know. We'll definitely fix this in the next release. Please use the workaround for now.

@mjackson
Copy link
Member

Just an update here: we've shipped history v1.16 which silences all warnings that were introduced into the history package since v1.13. Please give it a shot and let us know how it goes. If it goes well, we'll update the peer dep on the router.

Next time we ship those warnings will be in v2 of history, so you don't have to worry about it breaking your build until you intentionally upgrade.

@Download
Copy link
Contributor

I am unable to install ReactRouter due to this issue. I specify a dependency on (what I think is the right version) 1.13.0 but still I get this error. My dependencies from package.json:

  "dependencies": {
    ...
    "history": "^1.13.0",
    "react": "^0.14.3",
    "react-dom": "^0.14.3",
    "react-router": "^1.0.0"
  },

Error:

>npm install
npm WARN peerDependencies The peer dependency history@1.13.x included from react-router will no
npm WARN peerDependencies longer be automatically installed to fulfill the peerDependency
npm WARN peerDependencies in npm 3+. Your application will need to depend on it explicitly.
\
> history@1.16.0 postinstall c:\ws\bridalappnode\node_modules\history
> node ./npm-scripts/postinstall.js

Active code page: 65001
-


> react-router@1.0.2 postinstall c:\ws\bridalappnode\node_modules\react-router
> node ./npm-scripts/postinstall.js

Active code page: 65001
npm ERR! Windows_NT 6.3.9600
npm ERR! argv "C:\\Program Files\\nodejs\\\\node.exe" "C:\\Program Files\\nodejs\\node_modules\\npm\\bin\\npm-cli.js" "install"
npm ERR! node v0.12.7
npm ERR! npm  v2.11.3
npm ERR! code EPEERINVALID

npm ERR! peerinvalid The package history does not satisfy its siblings' peerDependencies requirements!
npm ERR! peerinvalid Peer react-router@1.0.2 wants history@1.13.x

npm ERR! Please include the following file with any support request:
npm ERR!     c:\ws\bridalappnode\npm-debug.log

It looks like it is trying to install 1.16.0 anyways... How to prevent it?

@Download
Copy link
Contributor

Update: changing deps to this seems to fix it:

"dependencies": {
    ...
  "history": "1.13.x",              <---- changed this
  "react": "^0.14.3",
  "react-dom": "^0.14.3",
  "react-router": "^1.0.0"
},

@forecho
Copy link

forecho commented Dec 18, 2015

@Download 👍

@curiouslychase
Copy link
Author

@Download fwiw, that was the recommendation in the opening issue comment of this thread.

@timdorr
Copy link
Member

timdorr commented Dec 20, 2015

Note that history 1.17.0 is out and doesn't have any deprecation warnings. Use it instead of 1.13.0 for now.

@Download
Copy link
Contributor

@chaseadamsio Yes, later I realized that as well... I completely misread the opening post and tried to set the dependency to 1.13.0

For me, using a letter instead of number in the version is just so unnatural! I unconsciously assumed that when it said 1.13.x it meant any micro version of 1.13...

@timdorr Great news! Will try!

@sudouser2010
Copy link

Thanks, updating history in the dependencies did the trick for me.

"dependencies": {
"history": "1.17.0",                <== updated this line here
"react-router": "^1.0.0-rc4",
}

@stiofand
Copy link

stiofand commented Nov 21, 2016

There is now also issue with router 3.0.0 and React + React-Dom ^15....

CircleCi builds also complaining:
react-router@3.0.0 requires a peer of react@^0.14.0 || ^15.0.0 but none was installed.

Been holding us up for a while, tried setting dependencies to required ones, but it doesn't work whatever the version.

@timdorr
Copy link
Member

timdorr commented Nov 21, 2016

@stevematdavies It sounds like your build on Circle is using npm 2.x (I believe this is the default). I haven't used them in a bit (still waiting on an invite to their 2.0 beta. Hint hint to any @circleci folks! 😉 ), but you might try bumping your node version to v6.1.0 (which bundles npm 3) or adding a pre: - npm install -g npm to your circleci.yml

This is the same format as react-redux. Dan has some more info on what's going on here: reduxjs/react-redux#342 (comment)

@lock lock bot locked as resolved and limited conversation to collaborators Jan 21, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests