nareshbhatia / mobx-state-router

MobX-powered router for React apps
https://nareshbhatia.github.io/mobx-state-router/
MIT License
227 stars 31 forks source link

npm install mobx-state-router error #145

Closed syncimprov closed 2 years ago

syncimprov commented 2 years ago

Apologize in advance if this is not related to anything in your repository, but I am getting this error trying to install mobx-state-router using npm:

npm ERR! code EINVALIDTAGNAME
npm ERR! Invalid tag name "^>=4": Tags may not have any characters that encodeURIComponent encodes.
nareshbhatia commented 2 years ago

Hmmm, I have no idea why!!! I just tried it and it installs without any issues. What version of npm are you running? Did you try it with yarn?

BTW, note that the version 6.00 is in beta, but pretty solid for use.

CleanShot 2021-11-20 at 19 55 27@2x
syncimprov commented 2 years ago

Thanks for the quick response, Naresh.

The issue seems to be the version of npm. Works on 6.4.1. Does not work on 8.1.0. All I am trying to do is run your quick start sample.

Screenshot of error (tried several variations with the same issue)

2021-11-20_18-19-34

I got it to install 6.0.0 on npm 8.1 after upping mobx and mobx-react:

"dependencies": {
    "mobx": "^6.3.7",
    "mobx-react": "^7.2.1",
    "mobx-state-router": "^6.0.0-beta.2",
    "react": "^16.13.1",
    "react-dom": "^16.13.1"
  },
nareshbhatia commented 2 years ago

So I think npm 7 & 8 are incompatible with version 6. You can try the --legacy-peer-deps with newer versions of npm and see if you can make it work. Otherwise, switch to yarn version 1.x. It is much more stable & robust.

syncimprov commented 2 years ago

I tried --legacy-peer-deps, but it did not work. Anyway, it is working with v6x. Thanks for your help.