Stopped working in Heroku environment
Nobody has claimed this yet.
- Dominant language
- JavaScript
- Stars
- 43.3k
- Forks
- 2.7k
- PR merge metrics
- No merged PRs in 30d
Description
What's going wrong?
since a few days ago, pm2 stopped working in Heroku machines.
I'm tried to use pm2 locally and globally, tried to revert to version 4.4.1, or 4.5.1, and upgraded to 4.5.5 - nothing works.
The only way to run my app is to roll back into a previous version. It looks like that even if I'm running a new build with the same version that worked - it will not work again.
don't need to say it but I will - it works fine locally, and inside dockerized servers (tested the same code at digitalocean).
How could we reproduce this issue?
Run an app using PM2 on Heroku.
the build will pass. after the build passed - see look at the runtime logs.
you will get this error:
internal/modules/cjs/loader.js:883
throw err;
^
Error: Cannot find module '@pm2/pm2-version-check'
Require stack:
- /app/node_modules/pm2/lib/VersionCheck.js
- /app/node_modules/pm2/lib/Worker.js
- /app/node_modules/pm2/lib/God.js
- /app/node_modules/pm2/lib/Daemon.js
- /app/node_modules/pm2/lib/Client.js
- /app/node_modules/pm2/lib/API.js
- /app/node_modules/pm2/index.js
- /app/node_modules/pm2/lib/binaries/Runtime4Docker.js
- /app/node_modules/pm2/bin/pm2-runtime
at Function.Module._resolveFilename (internal/modules/cjs/loader.js:880:15)
at Function.Module._load (internal/modules/cjs/loader.js:725:27)
at Module.require (internal/modules/cjs/loader.js:952:19)
at require (internal/modules/cjs/helpers.js:88:18)
at Object.<anonymous> (/app/node_modules/pm2/lib/VersionCheck.js:2:14)
at Module._compile (internal/modules/cjs/loader.js:1063:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:1092:10)
at Module.load (internal/modules/cjs/loader.js:928:32)
at Function.Module._load (internal/modules/cjs/loader.js:769:14)
at Module.require (internal/modules/cjs/loader.js:952:19) {
code: 'MODULE_NOT_FOUND',
requireStack: [
'/app/node_modules/pm2/lib/VersionCheck.js',
'/app/node_modules/pm2/lib/Worker.js',
'/app/node_modules/pm2/lib/God.js',
'/app/node_modules/pm2/lib/Daemon.js',
'/app/node_modules/pm2/lib/Client.js',
'/app/node_modules/pm2/lib/API.js',
'/app/node_modules/pm2/index.js',
'/app/node_modules/pm2/lib/binaries/Runtime4Docker.js',
'/app/node_modules/pm2/bin/pm2-runtime'
]
}
npm ERR! code ELIFECYCLE
npm ERR! errno 1
Supporting information
node 14.6
npm 6.x
tried pm2 versions: 4.4.1, 4.5.1*, 4.5.5*
(versions with * installed both locally and globally, at both "preinstall" and "prestart" npm hooks.)
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Reproduce the failure by running PM2 with pm2-runtime on Heroku and inspect the runtime logs. Start with pm2/lib/VersionCheck.js and the pm2-runtime entry point shown in the stack trace; the issue is done when the Heroku runtime starts without the MODULE_NOT_FOUND error for @pm2/pm2-version-check.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- javascript, node.js
- Domain
- cli, devops
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100