Closed finley541 closed 2 years ago
How to fix Error [ERR_REQUIRE_ESM]: require()
for the package chalk ?
Uninstall the package chalk
Do npm install chalk@4.1.0
^^ This should probably fix the error and your bot should start to work normally.
Thank you but I was wondering after I fixed the chalk issue, it started and I got this: Exception: ReferenceError: client is not defined
, then it shuts off.
Issue already open #131
When I use node . I get this error:
QiMac:REAPER-2.0 quinns$ node . internal/modules/cjs/loader.js:1080 throw new ERR_REQUIRE_ESM(filename, parentPath, packageJsonPath); ^
Error [ERR_REQUIRE_ESM]: Must use import to load ES Module: /Users/quinns/REAPER-2.0/node_modules/chalk/source/index.js require() of ES modules is not supported. require() of /Users/quinns/REAPER-2.0/node_modules/chalk/source/index.js from /Users/quinns/REAPER-2.0/index.js is an ES module file as it is a .js file whose nearest parent package.json contains "type": "module" which defines all .js files in that package scope as ES modules. Instead rename /Users/quinns/REAPER-2.0/node_modules/chalk/source/index.js to end in .cjs, change the requiring code to use import(), or remove "type": "module" from /Users/quinns/REAPER-2.0/node_modules/chalk/package.json.
code: 'ERR_REQUIRE_ESM' }