coder14
coder14

Reputation: 223

Can't install anything with npm (react)

I have cloned the Hot Reload Boilerplate (https://github.com/gaearon/react-hot-boilerplate) for my first react project.

Some days ago could install React Router using npm install --save react-router. But now I would like to install dependencies like Axios to get data using JSON (https://github.com/mzabriskie/axios), or this ReactCSSTransitionGroup from https://facebook.github.io/react/docs/animation.html, but when I run npm install axios I keep getting these errors:

npm ERR! Darwin 15.6.0
npm ERR! argv "/usr/local/bin/node" "/usr/local/bin/npm" "install" "--save" "axios"
npm ERR! node v4.5.0
npm ERR! npm  v2.15.9
npm ERR! code EPEERINVALID

npm ERR! peerinvalid The package [email protected] does not satisfy its siblings' peerDependencies requirements!
npm ERR! peerinvalid Peer [email protected] wants react@^0.14.8
npm ERR! peerinvalid Peer [email protected] wants react@^0.14.0 || ^15.0.0
npm ERR! peerinvalid Peer [email protected] wants react@^15.3.2

npm ERR! Please include the following file with any support request:
npm ERR!     /Users/Ludo/Documents/sites/react/FirstApp/npm-debug.log

And also when I run something like npm i I get these errors:

npm ERR! Darwin 15.6.0
npm ERR! argv "/usr/local/bin/node" "/usr/local/bin/npm" "i"
npm ERR! node v4.5.0
npm ERR! npm  v2.15.9
npm ERR! code EPEERINVALID

npm ERR! peerinvalid The package [email protected] does not satisfy its siblings' peerDependencies requirements!
npm ERR! peerinvalid Peer [email protected] wants react@^0.14.8
npm ERR! peerinvalid Peer [email protected] wants react@^0.14.0 || ^15.0.0
npm ERR! peerinvalid Peer [email protected] wants react@^15.3.2

npm ERR! Please include the following file with any support request:
npm ERR!     /Users/Ludo/Documents/sites/react/FirstApp/npm-debug.log

What does this mean, and how can I fix this?

Thanks!

Upvotes: 2

Views: 13075

Answers (3)

manish kr
manish kr

Reputation: 1

PS C:\Users\a\Desktop\project 1> npm version { npm: '8.3.0',
node: '17.3.0', v8: '9.6.180.15-node.12', uv: '1.42.0', zlib: '1.2.11', brotli: '1.0.9', ares: '1.18.1', modules: '102', nghttp2: '1.45.1', napi: '8', llhttp: '6.0.4', cldr: '40.0', icu: '70.1', tz: '2021a3', unicode: '14.0', ngtcp2: '0.1.0-DEV', nghttp3: '0.1.0-DEV' } PS C:\Users\a\Desktop\project 1> npx create-react-app my-app Need to install the following packages: create-react-app Ok to proceed? (y) y

You are running create-react-app 4.0.3, which is behind the latest release (5.0.0).

We no longer support global installation of Create React App. Please remove any global installs with one of the following commands:

  • npm uninstall -g create-react-app
  • yarn global remove create-react-app

https://create-react-app.dev/docs/getting-started/

PS C:\Users\a\Desktop\project 1> npm update

up to date, audited 1 package in 3s

found 0 vulnerabilities PS C:\Users\a\Desktop\project 1> npx create-react-app my-app Need to install the following packages: create-react-app Ok to proceed? (y)

You are running create-react-app 4.0.3, which is behind the latest release (5.0.0).

We no longer support global installation of Create React App. Please remove any global installs with one of the following commands:

PS C:\Users\a\Desktop\project 1> npx clear-npx-cache Need to install the following packages: clear-npx-cache Ok to proceed? (y) y PS C:\Users\a\Desktop\project 1> npx create-react-app my-app Need to install the following packages: create-react-app Ok to proceed? (y) y

this will work clear-npx-cache

Upvotes: 0

pavan kumar v
pavan kumar v

Reputation: 1

if you have turned on auto save , try unchecking that.

Upvotes: -2

BradByte
BradByte

Reputation: 11093

You're using an old version of npm (2.15.9). Run this to update it...

$ npm install -g npm

Then attempt to install your dependencies again.

Upvotes: 3

Related Questions