Big Daddy
Big Daddy

Reputation: 5224

NPM - Can't install packages

I inherited a React project and after getting the latest code it failed to run - the previous developer isn't available. So, with no experience, I got on with it

Here's a list of the thing I did:

So, now I can't even get npm install --verbose to work. It just hangs and gives no feedback. I can't reinstall Node because the jokers here got us locked-down.

What can I do to install the packages? Am I doomed?

UPDATE: I disconnected from the network and went on the company wifi and npm install worked. How can that be?

Upvotes: 0

Views: 109

Answers (1)

Kamil Naja
Kamil Naja

Reputation: 6682

Due to your update - probably your machine is behind the company proxy, that's why npm cannot get packages. To fix this find your proxy address, and after this run in terminal:

npm config set proxy http://yourproxy.company.com:8080
npm config set https-proxy http://yourproxy.company.com:8080

I found this method on https://jjasonclark.com/how-to-setup-node-behind-web-proxy/, works very good.

Upvotes: 1

Related Questions