Christmas-Community icon indicating copy to clipboard operation
Christmas-Community copied to clipboard

Bug: version 1.35.0

Open jskiddie opened this issue 1 year ago • 2 comments

Please add "node-fetch": "^2.7.0", to package.json as node-fetch 3 would require the use of the import statment `` which is only available in ts Error [ERR_REQUIRE_ESM]: Must use import to load ES Module: /home/user/CAMSERVER/node_modules/node-fetch/src/index.js require() of ES modules is not supported. require() of /home/user/CAMSERVER/node_modules/node-fetch/src/index.js from /home/user/CAMSERVER/server.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/user/CAMSERVER/node_modules/node-fetch/package.json. If you chose to switch to type script though please do me a big favour and use git mv to rename files in a seperate commit because otherwise renames are likely not tracked properly.

jskiddie avatar Dec 17 '23 02:12 jskiddie

I did port the project to TS today. Are you trying to execute the source code? Try npm run build then node built/index.js.

Wingysam avatar Dec 17 '23 02:12 Wingysam

Sorry the Issue isn't a hundred percent clear, I was trying to run the project at commit "1.35.0" and ran into the issue of missing node-fetch. Running npm install node-fetch yielded the import statment error, thus "node-fetch": "^2.7.0", was required in the package.json to fix the issue.

jskiddie avatar Dec 17 '23 23:12 jskiddie