40 lines
629 B
Markdown
40 lines
629 B
Markdown
|
nodejs安装命令
|
|||
|
==============
|
|||
|
|
|||
|
* 安装nodejs
|
|||
|
|
|||
|
```bash
|
|||
|
sudo apt-get install nodejs
|
|||
|
```
|
|||
|
* 安装npm
|
|||
|
|
|||
|
```bash
|
|||
|
sudo apt-get install npm
|
|||
|
```
|
|||
|
* 设置淘宝镜像源
|
|||
|
|
|||
|
```bash
|
|||
|
npm config set registry https://registry.npm.taobao.org
|
|||
|
```
|
|||
|
* 获取当前镜像源
|
|||
|
|
|||
|
```bash
|
|||
|
npm config get registry
|
|||
|
```
|
|||
|
* 安装淘宝的cnpm,然后在使用时直接将npm命令替换成cnpm命令即可
|
|||
|
|
|||
|
```bash
|
|||
|
npm install -g cnpm --registry=https://registry.npm.taobao.org
|
|||
|
```
|
|||
|
* 安装vue
|
|||
|
|
|||
|
```bash
|
|||
|
sudo npm install -g vue-cli
|
|||
|
```
|
|||
|
* 查看版本
|
|||
|
|
|||
|
```bash
|
|||
|
node -v
|
|||
|
npm -v
|
|||
|
vue -V
|
|||
|
```
|