如果网络条件允许,建议看原文。原文地址:http://thejackalofjavascript.com/getting-started-raspberry-pi-node-js/
If you are new to Node.js, I would recommend going through the following posts
You can run the below steps over ssh or you can run it using xterminal (as root) from the GUI. I will be running the below steps from the terminal (ssh on Mac/putty on windows). This will take comparatively less time when working with a GUI.
First we will update and upgrade our pi. Run
sudo apt-get update -y && sudo apt-get upgrade -y
This will take quite some time, if you are running this for the first time. (~ 1 hour)
Next, we will download the latest version of Node-ARM
wget http://node-arm.herokuapp.com/node_latest_armhf.deb
Install it by running
sudo dpkg -i node_latest_armhf.deb
If everything works fine without issues, you can run
node -v
and you should see the installed Node’s version.
You can also start off a Node REPL and log something like
Hope this post gave you a decent idea as how to setup Node.js on the Pi. If you think there is a more easy way of connecting the Pi to a computer, please do share.