No connection to NPM with DS-lite Internet connection

Hi there,

I have installed Node-Red v4.02 and Node.js v18.20.6 on my Raspberry Pi 3 Model B Plus Rev 1.3. and I use Debian GNU/Linux 12 (bookworm). When trying to install the node-red-dashboard palette, I also came across the «request to https://registry.npmjs.org/ failed» problem. The download attempt also failed with other pallets. My internet connection otherwise works fine.
After a long time of troubleshooting and overassignments, I came to the conclusion that it must still be due to my internet connection. I had recently changed the Internet provider and now use a DS-Lite connection. Can someone confirm my theory, please ? If so, I hope that there will be a solution to this problem soon...
Is there no way to download a module without npm directly as a tgz file?
Kind regards, Daniel

Can you ping registry.npmjs.org?

Are you running node-red in Docker or Home Assistant?

In DS-Lite, IPv4 packets from customer devices are encapsulated in IPv6 packets and sent through an IPv6-only network to the service provider's network, where they are then translated and forwarded to their destination.

:confused:

I hadn't come across this type of network standard before.

To expand on Colin's response. You might also try running a traceroute to see where things are getting lost.

If you can ping that address, try running an npm command from the command line and report back what error message you get.

Running npm outdated --verbose from your Node-RED userDir (usually ~/.node-red/) should give you some decent information.

I have a wlan router in between the modem. From this the ping fails to registry.npmjs.org.
If I use the wlan connection directly from the modem, the ping to registry.npmjs.org works.
So it looks that I also have a router configuration problem and will check my router settings again..
But the day before yesterday I had also established a direct internet connection between my modem and Raspberry pi, (attempted with network cable and wlan connection).
Again, I couldn't connect to the npmjs server.
I don't use node-Red via Docker or Home Assistant. It runs directly on the pi.

What is the error?
Can you ping 1.1.1.1?

Yes, ping 1.1.1.1 is successful
I made a direct connection from the Modem and made a traceroute now.
It seems to reach the npmjs.org server.
6 104.16.27.34 (104.16.27.34) 17.979 ms 8.911 ms 8.695 ms

Did you ping from the node-red instance or where your browser is running? The ping node is the best option since it actually pings from the node-red server (eg no doubts)

I made the ping in the terminal console from the raspi.
But it is also successful from the Node-Red Instance.

So are you still getting an error? If so exactly what is the error?

yes, i still got error messages.

[err] npm error network request to 
http://registry.npmjs.org/node-red-dashboard failed, 
reason: socket hang up`
This is a problem related to network connectivity.
In most cases you are behind a proxy or have bad network settings.
If you are behind a proxy, 
please make sure that the 'proxy' config is set properly.  
See: 'npm help config'
A complete log of this run can be found in: 
/home/pi-433/.npm/_logs/2025-02-09T21_41_22_524Z-debug-0.log

Your PI may not have IPV6 enabled.

Make sure to enable IPv6 on the PI (and in Docker if thats how you run) and your whole network.

Also, just in case, clear down proxy settings & remove/rename any npmrc files.

Hi Steve,

You're right, I had deactivated ipv6 for testing.
Now I have reactivated it, and verifyed that the Raspi gets an IPv4 and IPv6 address. :white_check_mark:
Also I have checked the proxy settings, these are disabled. :white_check_mark:
I have just installed the latest «bookworm» updates via this connection.
Is there a specific npmrc file that I should delete or rename in the .npm folder?
In the.npm directory I see the log files and a file with the name lastverivied.
For a change, I tried to install the dashboard palette via the terminal.
I still get the same error message.

did you restart node-red?
did you restart the device?

I would do a simple http-request test flow to see if internet on the NR is working.

e.g. inject -> http request (url: https://swapi.dev/api/people/1) --> debug

[{"id":"7e64f05fc9adeb3a","type":"inject","z":"77dbd3c4bb570dff","name":"","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"","payloadType":"date","x":1140,"y":580,"wires":[["109995ca87776014"]]},{"id":"109995ca87776014","type":"http request","z":"77dbd3c4bb570dff","name":"","method":"GET","ret":"obj","paytoqs":"ignore","url":"https://swapi.dev/api/people/1","tls":"","persist":false,"proxy":"","insecureHTTPParser":false,"authType":"","senderr":false,"headers":[],"x":1150,"y":640,"wires":[["f24d7e66ec255d50"]]},{"id":"f24d7e66ec255d50","type":"debug","z":"77dbd3c4bb570dff","name":"debug 12","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","statusVal":"","statusType":"auto","x":1160,"y":700,"wires":[]}]

if there is a .npmrc in ~/.node-red, delete it

also, to be sure, run

npm config --global rm proxy
npm config --global rm https-proxy
npm config rm proxy
npm config rm https-proxy
unset HTTP_PROXY
unset HTTPS_PROXY
unset http_proxy
unset https_proxy
1 Like

I have good news Steve, your npm config commands have solved the problem. :grinning:
Downloadig the dashboard palette was sucssesful.
Many thanks to you and Colin for your help.

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.