0

I have a project bill by loopback 4 use bitbucket to save source. Now I want to deploy project on vps.
My vps use OS centos 8. I installed Node, MongoDB, ...

I also install pm2 and config nginx.

I tried copy file dist from local to server and use command pm2 start index.js. But it not working.

I check pm2 error and see log:

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' }

Please help step to deploy and exist project to server vps.

Huan Ho
  • 145
  • 2
  • 9

0 Answers0