首页 文章详情

环境搭建

约 1 分钟阅读

一、UBUNTU18.04 安装

1、服务器创建用户

// /home 目录下创建 username 
sudo useradd -m -s /bin/bash username
// 设置密码
sudo passwd username
// 给username 赋予管理员权限
sudo vim /etc/sudoers
root ALL=(ALL:ALL)ALL
protagonisths ALL=(ALL:ALL)ALL

安装nodejs

curl -sL https://deb.nodesource.com/setup_10.x | sudo -E bash -
sudo apt-get install -y nodejs

https://github.com/nodesource/distributions#debinstall

安装yarn

curl -sL https://dl.yarnpkg.com/debian/pubkey.gpg | sudo apt-key add -
sudo apt-get update && sudo apt-get install yarn

安装Pm2

# 4.2.1
npm i -g pm2

安装mongo

# install
sudo apt-get install -y mongodb
# stop
sudo service mongodb stop
# setup
sudo service mongodb start

评论

正在加载评论...

相关文章