npm and node_index.js high CPU load

Having issues with your DietPi installation or found a bug? Post it here.
User avatar
Joulinar
Posts: 3821
Joined: Sat Nov 16, 2019 12:49 am

Re: npm and node_index.js high CPU load

Post by Joulinar »

there seems to be something else running. Usually Node-Red is executed as user nodered and not as user root. As well the command to start Node-Red is following

Code: Select all

/usr/local/bin/node-red -u /mnt/dietpi_userdata/node-red
Could that be a leftover from the stuff you are running on Node-Red?
Pls let us know if a solution is working. This could help others if they hit by similar situation. Your DietPi Team
User avatar
novitibo
Posts: 109
Joined: Mon Feb 29, 2016 5:11 pm

Re: npm and node_index.js high CPU load

Post by novitibo »

I'm just running backup restore right now.
Will chk node processes before another node-red installation and if there are some leftovers before, I'll uninstall them.

npm and node are installed with node-red, right?
User avatar
Joulinar
Posts: 3821
Joined: Sat Nov 16, 2019 12:49 am

Re: npm and node_index.js high CPU load

Post by Joulinar »

node is installed via node.js
Pls let us know if a solution is working. This could help others if they hit by similar situation. Your DietPi Team
User avatar
novitibo
Posts: 109
Joined: Mon Feb 29, 2016 5:11 pm

Re: npm and node_index.js high CPU load

Post by novitibo »

ooooooo
i forgot :lol: :? :cry:
https://www.zigbee2mqtt.io/getting_star ... 2mqtt.html is installed besides dietpi too :roll:
sorry

so, it looks like those 2 installations of node are restarting each other or what :P

now without node-red mentioned processes are stable and with low cpu load

what do you suggest for future node-red instalation?
User avatar
Joulinar
Posts: 3821
Joined: Sat Nov 16, 2019 12:49 am

Re: npm and node_index.js high CPU load

Post by Joulinar »

did you installed node.ja twice? You are not able to use node.js as installed by DietPi
Pls let us know if a solution is working. This could help others if they hit by similar situation. Your DietPi Team
User avatar
novitibo
Posts: 109
Joined: Mon Feb 29, 2016 5:11 pm

Re: npm and node_index.js high CPU load

Post by novitibo »

Joulinar wrote: Tue Jan 26, 2021 12:51 am did you installed node.ja twice? You are not able to use node.js as installed by DietPi
yes. zigbee2mqtt installation instructions are:
# Install Node.js;
sudo apt-get install -y nodejs git make g++ gcc

# Verify that the correct nodejs and npm (automatically installed with nodejs)
# version has been installed
node --version # Should output v12.X or v10.X
npm --version # Should output 6.X

I noticed, yes, zigbee2mqtt stops working after node-red instalation. grrrrr
what should I do? :cry: :cry: :cry: :cry: :cry:

now I have node v.12.0.0 and npm 6.9.0 under root .Node-red comes with latest versions...

if dietpi would offer zigbee2mqtt also, that won't be a problem anymore, am I right? ;)
User avatar
Joulinar
Posts: 3821
Joined: Sat Nov 16, 2019 12:49 am

Re: npm and node_index.js high CPU load

Post by Joulinar »

you could try to install node.js from dietpi-software first and check if Zigbee is able to install. Just don't install nodejs as reqjuested in Zigbee install guide. Btw, git as available via dietpi-software as well
novitibo wrote: Tue Jan 26, 2021 12:56 am now I have node v.12.0.0 and npm 6.9.0 under root .Node-red comes with latest versions...
Node-Red is not providing node.js. This is an own software package (ID 9)

DietPi is installing node.js directly from https://nodejs.org/dist/
Latest version is 15
Pls let us know if a solution is working. This could help others if they hit by similar situation. Your DietPi Team
User avatar
novitibo
Posts: 109
Joined: Mon Feb 29, 2016 5:11 pm

Re: npm and node_index.js high CPU load

Post by novitibo »

Joulinar wrote: Tue Jan 26, 2021 1:38 am you could try to install node.js from dietpi-software first and check if Zigbee is able to install. Just don't install nodejs as reqjuested in Zigbee install guide. Btw, git as available via dietpi-software as well
novitibo wrote: Tue Jan 26, 2021 12:56 am now I have node v.12.0.0 and npm 6.9.0 under root .Node-red comes with latest versions...
Node-Red is not providing node.js. This is an own software package (ID 9)

DietPi is installing node.js directly from https://nodejs.org/dist/
Latest version is 15
how do we use git from Dietpi?

sudo git clone https://github.com/Koenkk/zigbee2mqtt.git /opt/zigbee2mqtt
sudo: git: command not found
User avatar
novitibo
Posts: 109
Joined: Mon Feb 29, 2016 5:11 pm

Re: npm and node_index.js high CPU load

Post by novitibo »

CPU spiking is gone, but zigbee2mqtt too. :(
Node-red is working well.
User avatar
Joulinar
Posts: 3821
Joined: Sat Nov 16, 2019 12:49 am

Re: npm and node_index.js high CPU load

Post by Joulinar »

Did you tried to installgit via dietpi-software?
Pls let us know if a solution is working. This could help others if they hit by similar situation. Your DietPi Team
Post Reply