首页 > 解决方案 > 如何将项目环回 4 部署到 vps

问题描述

我有一个环回 4 使用 bitbucket 保存源的项目账单。现在我想在 vps 上部署项目。
我的 vps 使用 OS centos 8。我安装了 Node、MongoDB、...

我也安装pm2和配置nginx

我尝试将文件dist从本地复制到服务器并使用命令pm2 start index.js。但它不起作用。

我检查 pm2 错误并查看日志:

0|index    |     at Module.load (internal/modules/cjs/loader.js:653:32)
0|index    |     at tryModuleLoad (internal/modules/cjs/loader.js:593:12)
0|index    |     at Function.Module._load (internal/modules/cjs/loader.js:585:3)
0|index    |     at Module.require (internal/modules/cjs/loader.js:692:17) code: 'MODULE_NOT_FOUND' }
0|index    | { Error: Cannot find module '@loopback/boot'
0|index    |     at Function.Module._resolveFilename (internal/modules/cjs/loader.js:636:15)
0|index    |     at Module.Hook._require.Module.require (/usr/lib/node_modules/pm2/node_modules/require-in-the-middle/index.js:51:29)
0|index    |     at require (internal/modules/cjs/helpers.js:25:18)
0|index    |     at Object.<anonymous> (/usr/share/nginx/html/src/application.ts:1:1)
0|index    |     at Module._compile (internal/modules/cjs/loader.js:778:30)
0|index    |     at Object.Module._extensions..js (internal/modules/cjs/loader.js:789:10)
0|index    |     at Module.load (internal/modules/cjs/loader.js:653:32)
0|index    |     at tryModuleLoad (internal/modules/cjs/loader.js:593:12)
0|index    |     at Function.Module._load (internal/modules/cjs/loader.js:585:3)
0|index    |     at Module.require (internal/modules/cjs/loader.js:692:17) code: 'MODULE_NOT_FOUND' }

请帮助步骤将项目部署和存在到服务器 vps。

标签: node.jsloopbackloopback4

解决方案


推荐阅读