Install Node.js Npm on Raspberry 4 - Debian Buster
First off, there are multiple fine tutorials on how to install Node on the raspberry 3, but these are a bit out dated to use on the Raspberry 4 with Debian Buster installed. This post reveils the way to install on the Raspberry 4 with Debian buster.
- First verify you have the Raspbian 4 by running the command “uname -m”
This should result in the newly processor indentiefier “arm71” - Now visit https://nodejs.org/en/download/ and copy the link behind the button:
Linux Binaries (ARM) -> ARMv7 - Running the command “wget https://nodejs.org/dist/v10.16.3/node-v10.16.3-linux-armv7l.tar.xz” gets the file
(Mind if you have a Raspberry 3 you must use an other button, and the link above is per Oktober 2019, so by the time you read this you better get a fresh link yourself) - Now the file is in the location you ran the command and you can extract it by running the command:
“tar -xvf node-v10.16.3-linux-armv7l.tar.xz”
The filename might be different if your fresh link was different - The tax.xz file is extracted in a folder with the same name. Enter the folder with the command:
“cd node-v10.16.3-linux-armv7l/” - Copy the content to /usr/local/ by running the command:
“sudo cp -R * /usr/local/” - Node.js and npm are now installed. Move up one folder to remove the file and folder:
“cd ..”
“rm -rf rm -rf node-v10.16.3-linux-armv7l”
“rm -rf rm -rf node-v10.16.3-linux-armv7l.tar.xz” - Now verify it is working:
“node -v” => v10.16.3
“npm -v” => 6.9.0 - All is well, you are done
Sidenote:
- Raspberry 3 uses a different processor, this is what makes this tutorial fit the raspberry 4
- The raspberry 3 tutorials work with a tar.gz file the current tar.xz file on nodejs.org can not be extracted by the “tar -xzf” command, but requires the “tar -xvf” command as in the example above.