node.js - 如何将项目环回 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。
解决方案
推荐阅读
- xamarin - xamarin 形成动态图像 Tapgesture 识别器控件
- verilog - MSB 案例陈述
- matlab - 用于简单数学表达式等价逻辑的现有工具
- android - 插件版本以下的 kotlin 运行时
- javascript - 使用 Javascript ES5 创建自定义错误
- bash - 在 Gitlab CI 期间 Sed 无法替换引号中的字符串
- c# - 如何从 FileStream 创建 TextWriter
- wso2 - VFS:URL 参数 transport.vfs.passive 在 WSO2 EI 6.2.0 中不起作用
- django - Pytest 使用 django_db 和 rest 框架
- bash - 带有点 (.) 的 bash 命令的最终结果