You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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.
The text was updated successfully, but these errors were encountered:
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.
Please add
"node-fetch": "^2.7.0",
topackage.json
as node-fetch 3 would require the use of the import statment `` which is only available in tsError [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.
The text was updated successfully, but these errors were encountered: