I am getting this error while running sudo npm install
. On my server, npm was installed earlier. I\'ve tried to delete the package-lock.json
file,
This Worked for me . open the project in CMD the run
npm cache verify
npm install
npm start
There are several valid and helpful responses here, but I would like to add that in my case the simplest solution was:
After that everything ran smoothly.
I am behind my organization's proxy, running the following commands fixed the issue for me
npm config set proxy http://proxy.yourproxydomain.com:port
npm config set https-proxy http://proxy.yourproxydomain.com:port
npm config set strict-ssl false
npm config set registry https://registry.npmjs.org/
Actually the above is related to the network connectivity in side the server. When I've good connectivity in the server, the npm install gone good and didn't throw any error
I was using private npm registry and trying to install private npm module. Logging to npm local registry fixed it (used command npm --add-user
)
SherylHohman's answer solved the issue I had, but only after I switched my internet connection. Intitially, I was on the hard-line connection at work, and I switched to the WiFi connection at work, but that still didn't work.
As a last resort, I switched my WiFi to a pocket-WiFi, and running the following worked well:
npm cache verify
npm install -g create-react-app
create-react-app app-name
Hope this helps others.