Upgrading

Note: if you are using the preinstalled version on a Raspberry Pi, please refer to these instructions for upgrading a Pi.

Currently we require the use of npm version 2 or later, please check which version you have installed by running the command npm -v before upgrading. If necessary run

sudo npm i -g [email protected]
hash -r

If you have installed Node-RED as a global npm package, you can upgrade to the latest version with the following commands:

sudo npm cache clean
sudo npm install -g --unsafe-perm node-red

To check for outdated nodes that are installed in the user directory you can:

cd ~/.node-red
npm outdated

This will print a list of nodes that can be updated. To update them you can then run:

npm update              # to update all nodes, or
npm update foo          # to only update a node called foo

You will then need to stop and restart Node-RED.

Upgrading node.js

If you upgrade node.js, for example from v0.10.x to v4.6.x, it is better to stop Node-RED, and then re-install as follows:

sudo npm cache clean
sudo npm install -g --unsafe-perm node-red

You will also need to rebuild any nodes that have binary dependancies. If you installed them in the recommended ~/.node-red directory, you can do this by:

cd ~/.node-red
npm rebuild

You will then need to restart Node-RED.


Note: the reason for using the --unsafe-perm option is that when node-gyp tries to recompile any native libraries it tries to do so as a “nobody” user and then fails to get access to certain directories. This causes the nodes in question (eg serialport) not to be installed. Allowing it root access during install allows the nodes to be installed correctly during the upgrade.