Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error Message about: ERR_REQUIRE_ESM #37

Open
xstable opened this issue May 19, 2023 · 0 comments
Open

Error Message about: ERR_REQUIRE_ESM #37

xstable opened this issue May 19, 2023 · 0 comments

Comments

@xstable
Copy link

xstable commented May 19, 2023

I try to run my deploy-script, but got this error:

> DEPLOY_TYPE=production node scripts/deployment.cjs

start deployment.cjs
/home/me/myProject/node_modules/cli-progress/lib/formatter.js:1
const _stringWidth = require('string-width');
                     ^

Error [ERR_REQUIRE_ESM]: require() of ES Module /home/me/myProject/node_modules/string-width/index.js from /home/me/myProject/node_modules/cli-progress/lib/formatter.js not supported.
Instead change the require of index.js in /home/me/myProject/node_modules/cli-progress/lib/formatter.js to a dynamic import() which is available in all CommonJS modules.
    at Object.<anonymous> (/home/me/myProject/node_modules/cli-progress/lib/formatter.js:1:22)
    at Object.<anonymous> (/home/me/myProject/node_modules/cli-progress/lib/generic-bar.js:3:20)
    at Object.<anonymous> (/home/me/myProject/node_modules/cli-progress/lib/single-bar.js:1:21)
    at Object.<anonymous> (/home/me/myProject/node_modules/cli-progress/cli-progress.js:1:20)
    at Object.<anonymous> (/home/me/myProject/node_modules/ssh-deploy-release/dist/Remote.js:19:21)
    at Object.<anonymous> (/home/me/myProject/node_modules/ssh-deploy-release/dist/ssh-deploy-release.js:15:16)
    at Object.<anonymous> (/home/me/myProject/scripts/deployment.cjs:3:18) {
  code: 'ERR_REQUIRE_ESM'
}

Node.js v18.16.0

As you see in the above output, the error appears right before the second console.log, so the issue must be on ssh-deploy-release and it's dependencies.

image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant