Sounds like you have a slow connection. Try increasing the timeout from 30s to 60s by adding this to your .npmrc
file:
timeout=60000
You could also try adding
prefer-offline=true
if you are trying to save bandwidth or have a slow connection
Note: if you don’t have an .npmrc
file setup yet, you can create one here
- for Windows:
C:\Users\{username}\.npmrc
- for Mac/Linux
~/.npmrc
Or you can create one in the same directory as your project’s package.json
file.