Next.js Discord

Discord Forum

Can't install dependencies

Answered
Polar bear posted this in #help-forum
Open in Discord
Polar bearOP
OS: Fedora
NPM 10.5.0
Node: 20.12.2
Things I've tried:
npm config set registry https://registry.npmjs.org/
npm set registry=https://registry.npmjs.org/
deleting the node_modules folder
deleting the package-lock file
clearing the cache

The error message that I keep getting always looks something like this:
npm ERR! code ECONNRESET
npm ERR! syscall read
npm ERR! errno ECONNRESET
npm ERR! network Invalid response body while trying to fetch https://registry.npmjs.org/react-refresh: read ECONNRESET
npm ERR! network This is a problem related to network connectivity.
npm ERR! network In most cases you are behind a proxy or have bad network settings.
npm ERR! network
npm ERR! network If you are behind a proxy, please make sure that the
npm ERR! network 'proxy' config is set properly. See: 'npm help config'

Obviously some variation here and there but it is alway the same npm ERR network connectivity issues.
Answered by Polar bear
export NODE_OPTIONS=--no-network-family-autoselection
View full answer

5 Replies

Toyger
try to set your dns to google 8.8.8.8 or cloudflare 1.1.1.1
also try to open link directly https://registry.npmjs.org/react-refresh
is it showing text in browser, it is basically return json?
Polar bearOP
Solved.
I added:
Polar bearOP
export NODE_OPTIONS=--no-network-family-autoselection
Answer
Polar bearOP
To my bashrc and it works now