The installation seems to work fine in a new fresh project, however in my project with the following package.json, the installation fails. I believe it is due to incorrect configuration for support between commonjs and es modules.
error C:\Users\flynn\Desktop\Programming\JS\chessalyze\node_modules\canvas: Command failed.
Exit code: 1
Command: node-pre-gyp install --fallback-to-build --update-binary
Arguments:
Directory: C:\Users\flynn\Desktop\Programming\JS\chessalyze\node_modules\canvas
Output:
C:\Users\flynn\Desktop\Programming\JS\chessalyze\node_modules\string-width\index.js:2
const stripAnsi = require('strip-ansi');
^
Error [ERR_REQUIRE_ESM]: require() of ES Module C:\Users\flynn\Desktop\Programming\JS\chessalyze\node_modules\strip-ansi\index.js from C:\Users\flynn\Desktop\Programming\JS\chessalyze\node_modules\string-width\index.js not supported.
Instead change the require of C:\Users\flynn\Desktop\Programming\JS\chessalyze\node_modules\strip-ansi\index.js in C:\Users\flynn\Desktop\Programming\JS\chessalyze\node_modules\string-width\index.js to a dynamic import() which is available in all CommonJS modules.
at Object.<anonymous> (C:\Users\flynn\Desktop\Programming\JS\chessalyze\node_modules\string-width\index.js:2:19) {
code: 'ERR_REQUIRE_ESM'
}
chess-image-generator version:
1.0.9 (latest)
Steps to reproduce
yarn add chess-image-generator
The installation seems to work fine in a new fresh project, however in my project with the following
package.json
, the installation fails. I believe it is due to incorrect configuration for support between commonjs and es modules.Expected behavior
Package is installed successfully.
Actual behavior