You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Jan 13, 2024. It is now read-only.
When I use pkg to package a mjs file, the executable can be generated successfully. But when I run it, there is an error message:
node:internal/modules/cjs/loader:979
throw new ERR_REQUIRE_ESM(filename, true);
^
Error [ERR_REQUIRE_ESM]: require() of ES Module C:\snapshot\testpkg\app.mjs not supported.
Instead change the require of C:\snapshot\testpkg\app.mjs to a dynamic import() which is available in all CommonJS modules.
at Function.runMain (pkg/prelude/bootstrap.js:1847:12) {
code: 'ERR_REQUIRE_ESM'
}
Any resolution?
The text was updated successfully, but these errors were encountered:
When I use
pkg
to package a mjs file, the executable can be generated successfully. But when I run it, there is an error message:Any resolution?
The text was updated successfully, but these errors were encountered: