Closed AJANILOY closed 2 years ago
seems there have been some changes in newer versions of the dependencies that break the app
in the meantime, I have added packages.json with the dependency versions needed
CD to the app folder + run npm install
to have it install the required versions (node-fetch@2.6.1,discord.js@12.3.1,ms@2.1.2)
whenever i try to start the bot it says `internal/modules/cjs/loader.js:1015 throw new ERR_REQUIRE_ESM(filename, parentPath, packageJsonPath); ^
Error [ERR_REQUIRE_ESM]: Must use import to load ES Module: /home/aja/Documents/node_modules/node-fetch/src/index.js require() of ES modules is not supported. require() of /home/aja/Documents/node_modules/node-fetch/src/index.js from /home/aja/Documents/minecraft-server-status-bot-main/app.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 index.js to end in .cjs, change the requiring code to use import(), or remove "type": "module" from /home/aja/Documents/node_modules/node-fetch/package.json.
code: 'ERR_REQUIRE_ESM' } `