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

package.json without UTF-8 BOM #8

Open
sontono opened this issue Jan 3, 2022 · 3 comments
Open

package.json without UTF-8 BOM #8

sontono opened this issue Jan 3, 2022 · 3 comments

Comments

@sontono
Copy link

sontono commented Jan 3, 2022

UTF-8 BOM header (0xEF 0xBB 0xBF) causes that package.json is treated as no valid json, and so captchapng package can not be loaded (for example when using with jest 27.4.5)

@SpiritOfSpirt
Copy link

Thank you for your help as idea what is wrong. I have same issue with mocha.
So to fix this I've made small fix inside json file

"fix-captchapng": "sed -i '1s/^\\xEF\\xBB\\xBF//' node_modules/captchapng/package.json",
"test": "npm run fix-captchapng && cross-env TS_NODE_PROJECT=test/tsconfig.json npx mocha --config test/.mocharc.json",

So first is will remove this header and then run tests as usuall.
"mocha": "^10.2.0",

@wangyi7099
Copy link

wangyi7099 commented Aug 2, 2023 via email

@ZhongJunJimmy
Copy link

I have same issue with package project into an executable by [email protected].
My Nodejs version 16.15.0

image

I change the package.json file encoding from UTF-8 BOM to ANSI than solved this issue.

Repository owner deleted a comment Feb 2, 2024
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

4 participants