- Full Stack Web Development with Raspberry Pi 3
- Soham Kamani
- 293字
- 2021-07-15 17:10:30
Installing node on the Pi
There are many ways to install node on the Raspberry Pi, but the easiest one is using the Node Version Manager (nvm), which is an open source node installer and version manager.
First, install the curl command:
sudo apt-get update && sudo apt-get install curl
Then, install nvm via the install script:
curl -o- https://raw.githubusercontent.com/creationix/nvm/v0.33.1/install.sh | bash
The preceding command installs the latest version of nvm at the time of writing this. If you would like to install a later version, replace v0.33.1 in the URL with the latest version. Alternatively, you could see the complete installation command on nvms README page (https://github.com/creationix/nvm#install-script). Once nvm is installed, verify its installation by running this:
nvm --version
It should give you the version number that has been installed.
Now that we have VM installed, the next step is to install the desired version of node. You can see the active version of the node on the official website (https://nodejs.org). Currently, version 6 is the active version under Long Term Support (LTS) and is recommended for most users. To install this version, run the command:
nvm install 6
nvm should now automatically install the node on your machine along with npm. Verify that the node and npm are installed:
pi@raspberrypi:~ $ node -v
v6.10.2
pi@raspberrypi:~ $ npm -v
3.10.10
The second and third numbers for each version may be different depending on the date of installation, but if all else is well, then you have successfully installed the node on your Raspberry Pi.
- Learning Single:page Web Application Development
- Mastering JavaScript Object-Oriented Programming
- Mastering Ember.js
- Python機(jī)器學(xué)習(xí)基礎(chǔ)教程
- Learning DHTMLX Suite UI
- 工業(yè)機(jī)器人離線編程
- 深入理解BootLoader
- Android移動應(yīng)用項(xiàng)目化教程
- Java 9 with JShell
- Data Manipulation with R(Second Edition)
- AngularJS UI Development
- Java程序性能優(yōu)化實(shí)戰(zhàn)
- Continuous Integration,Delivery,and Deployment
- 代碼整潔之道:程序員的職業(yè)素養(yǎng)
- Java Web開發(fā)系統(tǒng)項(xiàng)目教程