Skip to content

Commit ca4eb6a

Browse files
author
Dave Conway-Jones
committed
keep trying to make Pi users not use default npm.
1 parent f9b9ea4 commit ca4eb6a

1 file changed

Lines changed: 13 additions & 4 deletions

File tree

docs/hardware/raspberrypi.md

Lines changed: 13 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,8 @@ title: Running on Raspberry Pi
44
---
55

66
From June 2018 Node-RED can be installed from the Pi Menu - Preferences - Recommended Software application installed on the Raspbian SD card image that can be downloaded from [RaspberryPi.org](https://www.raspberrypi.org/downloads/raspbian/). If installed in this manner it can be upgraded either by using `sudo apt-get upgrade` or using the script below.
7-
Once the script below has been run then you upgrade by re-running the script.
7+
Once the script below has been run, you should upgrade by re-running the script.
8+
If you decide to stick with apt to install npm then you must upgrade it to the latest by `sudo npm i -g npm` before adding any extra nodes.
89

910
### Install / Upgrade
1011

@@ -22,7 +23,7 @@ On really minimal Debian installs you may want to `sudo apt-get install build-es
2223
Nodes can be now be managed via the built in palette manager. However the default Pi install pre-loads some
2324
nodes globally and these cannot then be easily managed and updated. The intention of the script is to...
2425

25-
- upgrade an existing user to LTS 6.x or 8.x Node.js and latest Node-RED
26+
- upgrade an existing user to LTS 8.x Node.js and latest Node-RED
2627
- migrate any existing globally installed nodes into the users ~/.node-red space so they can be managed via the palette manager
2728
- optionally (re)install the extra nodes that are pre-installed on a full Raspbian Pi image
2829

@@ -39,7 +40,7 @@ The script will perform the following steps
3940
- remove any node-red binaries from /usr/bin and /usr/local/bin
4041
- remove any node-red modules from /usr/lib/node_modules and /usr/local/lib/node_modules
4142
- detect if Node.js was installed from Node.js package or Debian
42-
- if not v6 or newer - remove as appropriate and install latest v8 LTS (not using apt). It will leave Node.js 6 installs as-is.
43+
- if not v8 or newer - remove as appropriate and install latest v8 LTS (not using apt).
4344
- clean out npm cache and .node-gyp cache to remove any previous versions of code
4445
- install Node-RED latest version
4546
- re-install under the user account any nodes that had previously been installed globally
@@ -64,6 +65,12 @@ To see the list of nodes you had installed:
6465
cd ~/.node-red
6566
npm ls --depth=0
6667

68+
**Note**: It does not update any nodes you had previously installed locally. To do that go into your user directory and run the commands below. The versions of some nodes may be fixed by the `package.json` file in that directory - you may need to hand edit this to select the versions you require before running `npm update`.
69+
70+
cd ~/.node-red
71+
npm outdated
72+
npm update
73+
6774

6875
#### Swapping SD Cards
6976

@@ -90,11 +97,13 @@ If you want Node-RED to run when the Pi boots up you can use
9097

9198
sudo systemctl enable nodered.service
9299

100+
and likewise `sudo systemctl disable nodered.service` to disable autostart on boot.
101+
93102

94103
#### Adding nodes to preloaded version
95104

96105
To add additional nodes you must first install the `npm` tool, as it is not included
97-
in the default Raspbian installation. This is not necessary if you have upgraded to Node.js 6.x.
106+
in the default Raspbian installation. This is not necessary if you have upgraded to Node.js 8.x.
98107

99108
The following commands install `npm` and then upgrade
100109
it to the latest version.

0 commit comments

Comments
 (0)