pm2
pm2 copied to clipboard
es-module from node/bin treated as commonJS module
I use the package serve
which is a es-module since version 14.x
. I ran into the problem that PM2 thinks the package is not a es-module package even-tough it is. So I am getting Error [ERR_REQUIRE_ESM]: Must use import to load ES Module:
After some investigation I found out that pm2 loads the serve
package from [...]/node/v14.20.0/bin
. Its a binary and there is no package-json so PM2 fails to categorize.
Is there any way to fix this?