Node-Red Install error on Raspbian

Hi,
I am trying to install Node-Red on a raspberry pi 4 on Raspbian GNU/Linux 10 (buster)
(I am trying to setup a domoticz to comunicate with an ESP8266 using mqtt)

node - v : v12.16.2
npm -v : v6.14.4

after using the script :

bash <(curl -sL https://raw.githubusercontent.com/node-red/linux-installers/master/deb/update-nodejs-and-nodered)

I get :

All done.
  You can now start Node-RED with the command  node-red-start
  or using the icon under   Menu / Programming / Node-RED
  Then point your browser to localhost:1880 or http://{your_pi_ip-address}:1880

But when I try to start Node-Red (node-red-start) I get :

Node-RED is not yet fully installed
/usr/bin/node-red-start: line 91: update-nodejs-and-nodered: command not found

after reading the logs the first error I find is :
npm ERR! Response timeout while trying to fetch https://registry.npmjs.org/@node-red%2futil (over 30000ms)

I am struggeling for some time now... does someone have an idea of what is happening, and how I could fix it ?

best regards

have you tried running the script again? This looks like a network issue
Try entering https://registry.npmjs.org/@node-red%2futil in the browser and see if it comes back (it just did for me)

It displays the content in the browser (I also tryed before, forgot to mention it)
Yes sounds like a network issue for me too, but I don't get why ...

I just tryed again, and now the first error is :

npm ERR! Unexpected end of JSON input while parsing near '...-\r\nVersion: OpenPGP'

I don't know linux and raspbian enough yet... so I might have missed something obvious

I had a look in the log file : /root/.npm/_logs/2020-04-17T09_58_29_623Z-debug.log

And that's what I get :

type57 verbose stack SyntaxError: Unexpected end of JSON input while parsing near '...-\r\nVersion: OpenPGP'
57 verbose stack     at JSON.parse (<anonymous>)
57 verbose stack     at parseJson (/usr/lib/node_modules/npm/node_modules/json-parse-better-errors/index.js:7:17)
57 verbose stack     at /usr/lib/node_modules/npm/node_modules/node-fetch-npm/src/body.js:96:50
57 verbose stack     at processTicksAndRejections (internal/process/task_queues.js:97:5)

The npm site seems to have had some issues over the last few days. Run
npm cache clean --force
and run the script again.

Thanks, I think I understood something.

After running the clean cache command, and the script again,

I am back to the

npm ERR! Response timeout while trying to fetch https://registry.npmjs.org/@node-red%2fruntime (over 30000ms)

So the first time the fetch fails midway, and the second time the parsing fails because of the incomplete fetch (if that make sens) ...

The fetch is still not working in the end :frowning:

More details that can maybe give someone hints.

When I clean the cache, and try :

apt-get install nodered

I get :

Some packages could not be installed. This may mean that you have
requested an impossible situation or if you are using the unstable
distribution that some required packages have not yet been created
or been moved out of Incoming.
The following information may help to resolve the situation:

The following packages have unmet dependencies:
 nodered : Depends: npm (>= 5.8)
E: Unable to correct problems, you have held broken packages.

You can't install node-red like that if you are using the script. The equivalent is
sudo npm install -g --unsafe-perm node-red

1 Like

Can you confirm that running this on the pi works
wget https://registry.npmjs.org/@node-red%2fruntime

Sorry I can't test the command ...

I tryed to reinstall my raspbian and change my order of opperation.
So first thing when raspbian was up and running was to install node-red and then it worked flawlessly.

Maybe the installation of domoticz and the others plugins, messed up the dependencies needed for node-red.

I'll try installing again domoticz, and let you know if it still works, or if there is some kind of uncompatibility with the versions.

Thanks all for the help!

1 Like

It seems to be working.

Installed everything I needed in that order :
1 - raspbian buster
2 - node-red
3 - domoticz
4 - homebridge
5 - mosquito

The homebridge install was messing with the node.js and npm, I skipped this part as it was already installed by node-red. So my previous issue might be coming from that.

best regards,

1 Like

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