在linux中使用包管理器安装node.js
内容摘要
网上文章中,在linux下安装node.js都是使用源码编译,其实node的github上已经提供了各个系统下使用各自的包管理器(package manager)安装node.js的方法。
1. 在Ubuntu中,使用如下命
1. 在Ubuntu中,使用如下命
文章正文
网上文章中,在linux下安装node.js都是使用源码编译,其实node的github上已经提供了各个系统下使用各自的包管理器(package manager)安装node.js的方法。
1. 在Ubuntu中,使用如下命令:
https://deb.nodesource.com/setup | sudo bash -
sudo apt-get install -y nodejs
sudo apt-get install -y nodejs
如果需要使用npm安装本地组件,还需要执行如下命令:
https://deb.nodesource.com/setup | bash -
apt-get install -y nodejs
apt-get install -y nodejs
如果需要使用npm安装本地组件,还需要执行如下命令:
https://rpm.nodesource.com/setup | bash -
yum install -y nodejs
yum install -y nodejs
如果需要使用npm安装本地组件,还需要执行如下命令:
http://download.opensuse.org/repositories/devel:/languages:/nodejs/openSUSE_13.1/ \
Node.js
sudo zypper in nodejs nodejs-devel
Node.js
sudo zypper in nodejs nodejs-devel
5. 在Arch Linux中,使用如下命令:
复制代码 代码如下:
pacman -S nodejs
6. 在FreeBSD和OpenBSD中,使用如下命令:
复制代码 代码如下:
/usr/ports/www/node
cd /usr/ports/www/node-devel/ && make install clean
#或者
pkg_add -r node-devel
pkg install node
#或者
pkg install node-devel
以上就是本文的全部内容了,希望大家能够喜欢。
代码注释