Because the Raspberry Pi is an arm architecture, there is no binary package download for ARM architecture on Node. js.
Tried using APT package management installation and direct Node. JS source code compilation installation (compiled for four or five hours ...) ), did not succeed, reported an illegal instruction error, is expected to be caused by a compiler processor architecture Error.
just, Some of Google's small partners have Succeeded. I'm Not sure why, it could be a compile version number Issue.
Here is a relatively simple method. The test is Effective. In fact, it is in the history list of the official website found the old version number v0.10.28 ARM architecture binary Package. The history list of the official website Http://nodejs.org/dist.
The deployment method is as Follows:
wget HTTP://NODEJS.ORG/DIST/V0.10.28/NODE-V0.10.28-LINUX-ARM-PI.TAR.GZTAR-XZF node-v0.10.28-linux-arm-pi.tar.gz
After extracting, you can see the NODE-V0.10.28-LINUX-ARM-PI folder, which includes node and NPM in the bin Folder. For ease of use, Configure the Bin folder path inside the PATH environment Variable.
Edit the ~/.BASHRC file. Add the node environment variable to the file and add it to path:
Export node= your Node-v0.10.28-linux-arm-pi's path to export path= $PATH: $NODE/bin
After saving, run the source ~/.BASHRC command. This allows you to use the node and NPM commands directly. Can try node-v or npm-v command to print the current version, print it correctly is Successful.
Raspberry Pi installs Node. JS