Installation: Node-RED core 3.0.2 is not installed

Hi, I know this should be a simple problem to solve, but is driving me crazy. I have installed node-red plenty of times, some problem to solve some times, but ok. Now I'm stuck here. It's a fresch buster legacy installation on a pi 3.
During the installation I always get problem at this point.


if you see it names the log /root/.npm/_logs/2023-02-21T08_54_04_699Z-debug-0.log. but this path doesn't exist.
Regarding internet connectivity, it shouldn't be a problem. I can update, do everything. Moreover I'm not behind a proxy.
I have tryed to clean, purge, reinstall, even with apt install. But nothing

Please, in future, copy/paste logs rather than screenshot if possible.

Exactly what command did you use to install node-red? Did you use sudo?

What do you see if you run
sudo npm install -g --unsafe-perm node-red

image
and it still colntinues naming /root/.npm/_logs/ that doesn't exsist

Please read all of my previous post, take note of my first sentence, and answer the other question I asked.

What do these commands show
which node
which npm
node -v
npm --version

which node --> /usr/bin/node
which npm --> /usr/bin/npm
node -v --> v16.19.1
npm --version --> 8.19.3

Sorry. No, absolutly not. I don't use sudo. just the racomanded script
bash <(curl -sL https://raw.githubusercontent.com/node-red/linux-installers/master/deb/update-nodejs-and-nodered)
after sudo apt update && sudo apt full-upgrade

Very odd, what about
npm config list
npm list -g

Are you able to install nodes manually by going into your .node-red directory and running, for example
npm install node-red-simple-gate

test@test:~ $ npm config list
; "user" config from /home/test/.npmrc

registry = "http://registry.npmjs.org/"
update-notifier = false

; node bin location = /usr/bin/node
; node version = v16.19.1
; npm local prefix = /home/test
; npm version = 8.19.3
; cwd = /home/test
; HOME = /home/test
; Run `npm config ls -l` to show all defaults.
test@test:~ $ npm list -g
/usr/lib
├── corepack@0.15.1
├── node-red@3.0.2
└── npm@8.19.3

test@test:~ $ cd .node-red
test@test:~/.node-red $ npm install node-red-simple-gate
npm ERR! code E404
npm ERR! 404 Not Found - GET https://registry.npmjs.org/node-red-simple-gate - Not found
npm ERR! 404
npm ERR! 404  'node-red-simple-gate@*' is not in this registry.
npm ERR! 404
npm ERR! 404 Note that you can also install from a
npm ERR! 404 tarball, folder, http url, or git url.

npm ERR! A complete log of this run can be found in:
npm ERR!     /home/test/.npm/_logs/2023-02-21T10_31_37_536Z-debug-0.log

That should be npm install node-red-contrib-simple-gate

ops :grimacing: :grimacing: :grimacing:

test@test:~ $ cd .node-red
test@test:~/.node-red $ npm install node-red-contrib-simple-gate
npm notice Beginning October 4, 2021, all connections to the npm registry - including for package installation - must use TLS 1.2 or higher. You are currently using plaintext http to connect. Please visit the GitHub blog for more information: https://github.blog/2021-08-23-npm-registry-deprecating-tls-1-0-tls-1-1/
npm notice Beginning October 4, 2021, all connections to the npm registry - including for package installation - must use TLS 1.2 or higher. You are currently using plaintext http to connect. Please visit the GitHub blog for more information: https://github.blog/2021-08-23-npm-registry-deprecating-tls-1-0-tls-1-1/

added 1 package in 1m

12 packages are looking for funding
  run `npm fund` for details
test@test:~ $

`

Sorry about the node name error.

I notice that node red 3.0.2 is in fact installed. Does it run correctly?

I did see in the log earlier that the install did not replace the service file as it has been manually modified. Given that you said this is a fresh buster install, it is surprising that it has been modified.

I thought it was my mistake, too, in copy paste :slight_smile:

It seems to be installed but it doesn't work

test@test:~ $ node-red
-bash: node-red: comando non trovato
test@test:~ $ node-red-start

Node-RED is not yet fully installed. Please re-run the install script again manually.

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

then retry  node-red-start

test@test:~ $

Yes, it's a fresh installation ,but with this problem I've tryed several way to fix it before opening the topic. I don't understand which service file you are referring to.

It is in the second image you posted. This is an example of the problem with images, I can't copy/paste the text.

I also note that you installed it as the user iot, but you are now trying to run it as user test.

Why did you install buster rather than the current version?

In fact I haven't got any idea what the problem with npm is.
In your position I think I would start again, with a different, known good quality SD card, install the latest Pi OS, run apt update, apt full-upgrade and try again with the script. This time if it doesn't work come straight back and show us the install log.

I have no good justification for the suggestion but given it's a legacy OS, I would try installing with node.js v14

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

Yes I'll do it. I'm using buster (legacy version) for standard policy. It is a kind of LTE. It is strange because this is the first time.that happens.
Thinking better, a main difference with the previous installation is that I'm doing it remotly. But I don't think it could be due to this, doesn't it?

I see it. I noticed it but I didn't got it meaning. I'll delete it and make another test
Thanks

Too late probably but what is in it.
I wonder if you get that message if you re-run the script as a different user.

Thanks, you read my mind. I was just looking how t install with a previous nodejs version. I'm sure I did it with the previous one on a same buster legacy, the 16.19.0

This is waht there inside it

# systemd service file to start Node-RED

[Unit]
Description=Node-RED graphical event wiring tool
Wants=network.target
Documentation=http://nodered.org/docs/hardware/raspberrypi.html

[Service]
Type=simple
# Run as normal pi user - change to the user name you wish to run Node-RED as
User=pi
Group=pi
WorkingDirectory=/home/pi

Environment="NODE_OPTIONS=--max_old_space_size=256"
# define an optional environment file in Node-RED's user directory to set custom vari$
EnvironmentFile=-/.node-red/EnvironmentFile
# uncomment and edit next line if you need an http proxy
#Environment="HTTP_PROXY=my.httpproxy.server.address"
# uncomment the next line for a more verbose log output
#Environment="NODE_RED_OPTIONS=-v"
# uncomment next line if you need to wait for time sync before starting
#ExecStartPre=/bin/bash -c '/bin/journalctl -b -u systemd-timesyncd | /bin/grep -q "s$

ExecStart=/usr/bin/env node-red-pi $NODE_OPTIONS $NODE_RED_OPTIONS
#ExecStart=/usr/bin/env node $NODE_OPTIONS red.js $NODE_RED_OPTIONS
# Use SIGINT to stop
KillSignal=SIGINT
# Auto restart on crash
Restart=on-failure
RestartSec=20
# Tag things in the log
SyslogIdentifier=Node-RED
#StandardOutput=syslog

[Install]
WantedBy=multi-user.target

Yes, I tested with several users, including pi. Always the same result

Probably the message was because you were running the script as a different user. If you start again make sure you run the command as the user you want to run node red as a service.

That doesn't explain the npm issues.

:man_cook:Thanks to all. Nothing, even with node 14 it doesn't work. I hoped in a solution because it is a remote installation, but that's it