- 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.
- Java入門經典(第6版)
- Python量化投資指南:基礎、數據與實戰
- Practical Data Science Cookbook(Second Edition)
- Web開發的貴族:ASP.NET 3.5+SQL Server 2008
- 人人都是網站分析師:從分析師的視角理解網站和解讀數據
- Java應用開發技術實例教程
- Java EE 7 Performance Tuning and Optimization
- Android開發:從0到1 (清華開發者書庫)
- Haskell Data Analysis Cookbook
- C和C++游戲趣味編程
- Getting Started with Python
- TypeScript 2.x By Example
- 算法圖解
- Android應用開發實戰(第2版)
- Moodle 3.x Developer's Guide