Getting this error while running file created by pkg
Discussed in https://github.com/vercel/pkg/discussions/1716
Originally posted by soroushBgm August 2, 2022 I run the file created by pkg with pm2 and get this error. app.js is the entry point I used while creating the file.
Error: Cannot find module '/root/project/app.js'
at Function.Module._resolveFilename (node:internal/modules/cjs/loader:933:15)
at Function.Module._load (node:internal/modules/cjs/loader:778:27)
at Object.<anonymous> (/root/.nvm/versions/node/v16.14.2/lib/node_modules/pm2/lib/ProcessContainerFork.js:33:23)
at Module._compile (node:internal/modules/cjs/loader:1103:14)
at Object.Module._extensions..js (node:internal/modules/cjs/loader:1157:10)
at Module.load (node:internal/modules/cjs/loader:981:32)
at Function.Module._load (node:internal/modules/cjs/loader:822:12)
at Function.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:77:12)
at node:internal/main/run_main_module:17:47 {
code: 'MODULE_NOT_FOUND',
requireStack: []
}
Actually I get this error when I delete my source and just run the exported file by pkg. So if the source must be there to be executed, what's the point of packaging?
+1, Having a similar issue with my entry point
This issue is stale because it has been open 90 days with no activity. Remove the stale label or comment or this will be closed in 5 days. To ignore this issue entirely you can add the no-stale label
This issue is now closed due to inactivity, you can of course reopen or reference this issue if you see fit.