mynote/nodejs/install.md
2018-03-05 14:52:48 +08:00

29 lines
566 B
Markdown
Executable File

# install nodejs npm
- refer to https://segmentfault.com/a/1190000007542620
### install and update
``` bash
sudo apt install nodejs
sudo apt install npm
sudo npm install n@latest -g
sudo n stable
sudo npm install npm@latest -g
node -v
npm -v
sudo npm install -g cnpm --registry=https://registry.npm.taobao.org
#or
npm config set registry https://registry.npm.taobao.org
npm config get registry
```
- if error: /usr/bin/env: node: No such file or directory
> ln -s /usr/bin/nodejs /usr/bin/node
- if old nodejs still exist
> sudo apt-get purge nodejs