在所有的象棋文档中,都使用了const chess = require('chess');
.
但是,当我try 使用此语法时,我收到以下错误:
const Chess = require('chess');
^
Error [ERR_REQUIRE_ESM]: require() of ES Module is not supported.
Instead change the require of main.js to a dynamic import() which is available in all CommonJS modules.
at Object.<anonymous> {
code: 'ERR_REQUIRE_ESM'
}
有没有解决这个问题的办法?