electron/rebuild

ERR_REQUIRE_ESM

zkcrescent opened this issue · 1 comments

Run electron-rebuild -w @u4/opencv4nodejs

encountering error :
`
node_modules/cliui/build/index.cjs:293
const wrap = require('wrap-ansi');
^

Error [ERR_REQUIRE_ESM]: require() of ES Module node_modules/wrap-ansi/index.js from node_modules/cliui/build/index.cjs not supported.
Instead change the require of index.js in node_modules/cliui/build/index.cjs to a dynamic import() which is available in all CommonJS modules.
at Object. (node_modules/cliui/build/index.cjs:293:14)
at Object. (node_modules/yargs/build/index.cjs:1:60678)
at Object. (node_modules/yargs/yargs:3:69)
at Object. (node_modules/@electron/rebuild/lib/cli.js:34:33) {
code: 'ERR_REQUIRE_ESM'
}
`

this problem resolved by install @u4/opencv4nodejs automatic