说明:有时候我们运行某个软件需要用到Node.js环境,而系统也没有装,这时候我们需要自己安装了,这里说下快速安装方法。
1、升级系统源和安装需要的软件
apt-get update -y
apt-get install -y build-essential curl
2、安装Node.js最新版本v8.xNode.js官方GitHub地址:https://github.com/nodesource/distributions
# Ubuntu系统
curl -sL https://deb.nodesource.com/setup_8.x | sudo -E bash -
sudo apt-get install -y nodejs
# Debian系统
curl -sL https://deb.nodesource.com/setup_8.x | bash -
apt-get install -y nodejs
3、查看当前Node.js版本
node -v
通过查看,我们可以看到当前Node.js是最新的v8.x版本。
提示:如果我们需要其他版本的Node.js,我们只需要将安装里面下载链接setup_8.x替换成其它即可,如setup_7.x.
![[教程]Cursor和VSCode无法写入用户设置 请打开用户设置并清除错误或警告,然后重试](https://www.aiwanba.net/wp-content/themes/Git-alpha/timthumb.php?src=https://www.aiwanba.net/wp-content/themes/Git-alpha/assets/img/pic/5.jpg&h=110&w=185&q=90&zc=1&ct=1)
![[教程]17 个全球最佳免费虚拟电话号码(手机、WhatsApp)](https://www.aiwanba.net/wp-content/themes/Git-alpha/timthumb.php?src=https://www.aiwanba.net/wp-content/themes/Git-alpha/assets/img/pic/4.jpg&h=110&w=185&q=90&zc=1&ct=1)
![[教程]安装.Net Framework 4.8 时出现未安装成功](https://www.aiwanba.net/wp-content/themes/Git-alpha/timthumb.php?src=/image/https://img-blog.csdnimg.cn/20210603091820696.png?x-oss-process=image/watermark,type_ZmFuZ3poZW5naGVpdGk,shadow_10,text_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L2d1eXVlbGluMTIz,size_16,color_FFFFFF,t_70#pic_center&h=110&w=185&q=90&zc=1&ct=1)
![[教程]Win7 安装.net Framework 4.8失败,提示:已处理证书链,但是在不受信任提供程序信任的根证书中终止。](https://www.aiwanba.net/wp-content/themes/Git-alpha/timthumb.php?src=https://lexsion.com/usr/uploads/2020/03/1453062917.jpg&h=110&w=185&q=90&zc=1&ct=1)