mathiasrw / rexreplace

Smooth find & replace CLI as it should be: simple file selection with globs, flexible patterns with regex and dynamic replacements from js code.
26 stars 3 forks source link

Error with Node v18.16.1 #345

Closed mtskf closed 7 months ago

mtskf commented 1 year ago

Hi there, I've encountered error with node v18.16.1. I'd appreciate it if you could help! Thanks 😊

Here's the error log:

$ rexreplace '§§§§' '§§' ./dist/css/*.css -V
/Users/********/********/node_modules/cliui/build/index.cjs:293
const wrap = require('wrap-ansi');
             ^

Error [ERR_REQUIRE_ESM]: require() of ES Module /Users/********/********/node_modules/wrap-ansi/index.js from /Users/********/********/node_modules/cliui/build/index.cjs not supported.
Instead change the require of index.js in /Users/********/********/node_modules/cliui/build/index.cjs to a dynamic import() which is available in all CommonJS modules.
    at Object.<anonymous> (/Users/********/********/node_modules/cliui/build/index.cjs:293:14)
    at Object.<anonymous> (/Users/********/********/node_modules/yargs/build/index.cjs:2861:12)
    at Object.<anonymous> (/Users/********/********/node_modules/yargs/index.cjs:5:30)
    at /Users/********/********/node_modules/rexreplace/bin/rexreplace.cli.js:442:17
    at Object.<anonymous> (/Users/********/********/node_modules/rexreplace/bin/rexreplace.cli.js:671:3) {
  code: 'ERR_REQUIRE_ESM'
}
mathiasrw commented 1 year ago

Thank you for this, and sorry about the slow response time.

mathiasrw commented 1 year ago

The dependencies were not strict. It is fixed now with the latest release. Any chance you can confirm its working again for you?