pkg icon indicating copy to clipboard operation
pkg copied to clipboard

Getting this error while running file created by pkg

Open leobgm opened this issue 3 years ago • 1 comments

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?

leobgm avatar Aug 02 '22 18:08 leobgm

+1, Having a similar issue with my entry point

TheDechev avatar Sep 18 '22 10:09 TheDechev

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

github-actions[bot] avatar Dec 18 '22 00:12 github-actions[bot]

This issue is now closed due to inactivity, you can of course reopen or reference this issue if you see fit.

github-actions[bot] avatar Dec 23 '22 00:12 github-actions[bot]