linux-tutorial/docs/linux/soft/nodejs.md
2019-05-08 22:34:51 +08:00

61 lines
1.1 KiB
Markdown
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

# Nodejs 安装
<!-- TOC depthFrom:2 depthTo:3 -->
- [安装方法](#安装方法)
- [先安装 nvm](#先安装-nvm)
- [安装 Nodejs](#安装-nodejs)
- [脚本](#脚本)
<!-- /TOC -->
## 安装方法
### 先安装 nvm
推荐安装 nvm(Node Version Manager) ,来管理 node.js 版本。
安装步骤如下:
1执行安装脚本
```
rm -rf ~/.nvm
curl -o- https://raw.githubusercontent.com/creationix/nvm/v0.33.8/install.sh | bash
. ~/.nvm/nvm.sh
```
2检验是否安装成功
执行 `nvm --version` 命令。
注意:如果出现 `nvm: command not found` ,关闭终端,然后再打开终端试试。
### 安装 Nodejs
安装步骤如下:
1使用 nvm 安装 nodejs 指定版本
执行以下命令:
```
nvm install 8.9.4
nvm use 8.9.4
```
2检验是否安装成功
执行 `node --version` 命令。
注意:如果出现 `node: command not found` ,关闭终端,然后再打开终端试试。
## 脚本
| [安装脚本](https://github.com/dunwu/OS/tree/master/codes/deploy/tool/nodejs) |
## 更多内容
- **引申**
- [操作系统、运维部署总结系列](https://github.com/dunwu/OS)