Because the Raspberry Pi is an arm architecture, there is no binary package download for ARM architecture on node. js. Tried using apt package to manage installation and direct node. JS source code compilation installation (compiled for four or five hours ...) ), failed to report an illegal instruction error, or due to a compiled processor architecture error. However, some of Google's small partners have succeeded, I do not know why, it may be the version of the issue of the compilation.
Here is a relatively simple method, the pro-test is effective. In fact, it is in the history list of the official website found the old version of v0.10.28 ARM Architecture binary Package, the official website history list 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 it, you can see the NODE-V0.10.28-LINUX-ARM-PI directory, which contains the bin directory with node and NPM. For ease of use, configure the bin directory 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, execute the source ~/.BASHRC command. This allows you to use the node and NPM commands directly, and you can try the node-v or NPM-V command to print the current version number and print it correctly.
Raspberry Pi installs node. js