Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bug: version 1.35.0 #123

Open
jskiddie opened this issue Dec 17, 2023 · 2 comments
Open

Bug: version 1.35.0 #123

jskiddie opened this issue Dec 17, 2023 · 2 comments

Comments

@jskiddie
Copy link
Contributor

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.

@Wingysam
Copy link
Owner

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.

@jskiddie
Copy link
Contributor Author

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants