首页 > Web开发 > 详细

搭建 Nodejs 生产环境

时间:2017-10-18 12:19:07      阅读:280      评论:0      收藏:0      [点我收藏+]

1、环境:阿里云ubuntu16.04

2、更新:sudo apt-get update

3、安装相关依赖文件:

sudo apt-get install vim openssl build-essential libssl-dev wget curl git

4、安装nvm

https://github.com/creationix/nvm 找到,并使用

curl -o- https://raw.githubusercontent.com/creationix/nvm/v0.33.5/install.sh | bash
下载完成后
source ~/.bashrc
完成后重新打开一个终端

技术分享

 5、使用nvm 安装 nodejs稳定版本(截至20171015)

nvm install 6.11.4

技术分享

技术分享

6、指定系统默认版本:

nvm use 6.11.4

技术分享

nvm alias default 6.11.4

技术分享

7、将npm源设置成淘宝源

npm --registry=https://registry.npm.taobao.org install -g npm

技术分享

 监控文件数目:

echo fs.inotify.max_user_watches=524288 | sudo tee -a /etc/sysctl.conf && sudo sysctl -p

8、安装cnpm

npm --registry=https://registry.npm.taobao.org install -g cnpm

9、安装常用全局工具包(按需选择性安装):

npm install pm2 webpack gulp grunt-cli -g

 

搭建 Nodejs 生产环境

原文:http://www.cnblogs.com/xz1024/p/7685578.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!