node安装配置

警告
本文最后更新于 2019-11-20,文中内容可能已过时。

nvm,npm,nrm

nvm git

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.35.3/install.sh | bash

source .bashrc

nvm --version
nvm ls-remote
nvm install 10.16.0
which node

nvm list
nvm use 10
nvm alias default 10

nvm reinstall-packages 10
1
2
npm -v
npm install -g npm    // -P  -D  -g
1
2
3
4
5
6
7
npm install --global nrm
nrm test
nrm ls
nrm use cnpm

// 推荐使用cnpm部署私有源镜像服务器
nrm add yourcompany http://registry.npm.yourcompany.com/
1
2
3
4
5
6
7
sudo apt-get install g++ curl libssl-dev apache2-utils git-core build-essential

git clone https://github.com/nodejs/node.git
cd node
./configure
make
sudo make install