Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

Serefei's avatar

Running `npm install` Throws `ENOTFOUND registry.npmjs.org`

I'm trying to implement Laravel mix on my current project. However, upon running npm install it gives me this error

npm ERR! code ENOTFOUND
npm ERR! errno ENOTFOUND
npm ERR! network request to https://registry.npmjs.org/@babel/parser/-/parser-7.11.5.tgz failed, reason: getaddrinfo ENOTFOUND registry.npmjs.org
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.

I tried to check ping most of the daily sites I used and all returned good aside from registry.npmjs.org

Tried to access https://registry.npmjs.org/ on browser and gives me this

This site can’t be reached
registry.npmjs.org’s server IP address could not be found.

I would like to ask if this is happening on your side as well. Please let me know your advice.

Thanks in advance!

0 likes
4 replies
automica's avatar

@serefei are you running npm install inside a VM or on your local filesystem?

if its docker, then you should try restarting

sudo service docker restart
Serefei's avatar

Hi @automica thanks for the help. I am running on local file system, ubuntu web apache2. After thorough investigation on what's happening on my end I found out that this was a "modem" or network issue on my connectivity.

What happened is that I connected my laptop to my mobile phone's hotspot and tried accessing https://registry.npmjs.org/ it worked fine. Return values from the registry has been received. Also, I am now successful running npm install and npm run dev.

On the other hand, troubleshoot my modem and network, it's all good now. I appreciate your help, thanks! :)

(It was weird tho that only registry.npmjs.org is not returning ping status and dns at that time.)

Serefei's avatar

Oh, thanks for this info. I think this is the better way. I changed my dns as well

Please or to participate in this conversation.