**CentOS 系统可以直接使用 yun 命令 **
安装 node
1, 使用 Git 将源码克隆到本地的~/.nvm 目录下, 并检查最新版本.
- > yum install Git
- > Git clone https://github.com/cnpm/nvm.git ~/.nvm && cd ~/.nvm && Git checkout `git describe --abbrev=0 --tags`
2, 激活 NVM.
- > echo ". ~/.nvm/nvm.sh">> /etc/profile
- > source /etc/profile
3, 列出 Node.JS 的所有版本.
> nvm list-remote
4, 安装需要的 node 版本
- > nvm install v8.12.0
- > nvm install v10.15.0
5, 运行 nvm ls 查看已安装的 Node.JS 版本
6, 可以使用 nvm use v8.12.0 进行切换 node 的版本
7 , 可以使用 node -v NPM -v 命令检查是否安装好 node
安装 ngnix
1, 安装 ngnix
> yum install -y nginx
2, 设置开机启动
- > systemctl start nginx.service
- > systemctl enable nginx.service
附加点
cd /usr/share/nginx/html ngnix 的首页 HTML 文件目录
cd /etc/nginx 配置 ngnix
vi nginx.conf
/sbin/nginx -s reload 重启命令
来源: http://www.bubuko.com/infodetail-3344499.html