Node-red won't start - invalid directory

I needed to re-install node-red so I completely removed nodejs, npm, and node-red. I then went through the install process again by first installing nodejs (version 10.x), then using npm to install node-red via the command:

sudo npm install -g --unsafe-perm node-red node-red-admin

I then went to run node red with the command: node-red

The error I got was "/usr/local/bin/node-red: No such file or directory".

Can anyone tell me why I'm getting this error? It appears I have node-red in my /usr/bin directory. So why does my installation seem to think it should be looking elsewhere?

Any pointers are appreciated.


You don’t say which versions of node npm you installed or which operating system you installed on.

All might be useful in identifying what went wrong, as would the output from the npm command

If you are installing on a Pi, follow:

I appologize.
OS: Ubundu 16.04 LTS
npm: 6.4.1
node: 10.15.3

Output after npm install command:
/usr/bin/node-red -> /usr/lib/node_modules/node-red/red.js
/usr/bin/node-red-pi -> /usr/lib/node_modules/node-red/bin/node-red-pi
/usr/bin/node-red-admin -> /usr/lib/node_modules/node-red-admin/node-red-admin.js

  • node-red-admin@0.1.5
  • node-red@0.20.3
    updated 2 packages in 19.865s

Interestingly enough though the issue seemed to resolve itself. I tried uninstalling everything and removing all directories corresponding to the install. Then I ran the install again (including re-installing NodeJS according to the node-red website). I still had issues. Uninstalled again, re-installed, still had issues, that's when I posted.

I gave it a rest over night, and in the morning ran "sudo npm remove --purge node-red node-red-admin" to purge everything out. Also I ran a "sudo apt-get remove --purge nodejs" to clear out all node-js installs. Then I went back to the node-red website and again followed the steps for the ubuntu install and this time it works. I'm not sure what happened differently this time from the last few times I attempted but it seems to work now.

Thanks for being willing to assist!

1 Like

For future reference the Pi install script generally works fine on Ubuntu.