Search code examples
javascriptnode.jsreactjsionic-frameworknpm

Why does "npm install" tell me "none is installed You must install peer dependencies yourself:"?


I'm trying to get a react/redux/ionic app working.

When I run npm install I get errors:

>`enter code here`npm install
npm WARN @ionic/[email protected] requires a peer of react-router@^4.3.1 but none is installed. You must install peer dependencies yourself.
npm WARN @ionic/[email protected] requires a peer of react-router-dom@^4.3.1 but none is installed. You must install peer dependencies yourself.

But when I look in package.json it certainly looks as if react-router and react-router-dom should be installed:

"@ionic/react": "0.0.5",
"react": "^16.8.6",
"react-dom": "^16.8.6",
"react-redux": "^7.0.3",
"react-router": "^5.0.0",
"react-router-dom": "^5.0.0",
"react-scripts": "3.0.1",
"redux": "^4.0.1",

Any ideas as to what might be going on?


Solution

  • Look at the version supplied by the warning message you need to uninstall the newer versions and re-install the specifically supplied versions uninstall:

    npm uninstall react-router react-router-dom
    

    (as a sanity check, look at package.json to confirm removed) then install specifically needed versions as supplied in warning

    npm i -S react-router@^4.3.1 react-router-dom@^4.3.1