The deployment process of nuxt project in Linxu environment

  1. You can also choose to download and upload by yourself when installing the node environment
      wget https://nodejs.org/dist/v8.11.3/node-v8.11.3-linux-x64.tar.xz
    
  2. Unzip node
      tar -Jxv -f xxx.tar.xz
    
  3. Establish a soft connection so that node npm can run globally
    ln -s /you_path/node-v8.11.3-linux-x64/bin/node /usr/local/bin/node
    ln -s /you_path/node-v8.11.3-linux-x64/bin/npm /usr/local/bin/npm
    
  4. Use node --version to verify whether the link installation is successful
  5. Install and switch Taobao mirror to speed up the download speed of the package
      npm install -g cnpm --registry=https://registry.npm.taobao.org
      ln -s /you_path/node-v8.11.3-linux-x64/bin/cnpm /usr/local/bin/cnpm
    
  6. Install pm2 node process management tools, performance monitoring, restart and reload, etc.
      cnpm i pm2 -g
      ln -s /you_path/node-v8.11.3-linux-x64/bin/pm2 /usr/local/bin/pm2
    
  7. Nginx reverse proxy configuration to access the application ip generated by the domain name proxy to the server
  8. pm2 management application
      pm2 start npm --name 'egou' -- run start 启动应用
      pm2 restart egou 重启
    

Guess you like

Origin blog.csdn.net/weixin_40599109/article/details/109249048