mocha: Error after updating to 6.1.0
$ yarn test
yarn run v1.3.2
(node:6135) [DEP0005] DeprecationWarning: Buffer() is deprecated due to security and usability issues. Please use the Buffer.alloc(), Buffer.allocUnsafe(), or Buffer.from() methods instead.
warning package.json: License should be a valid SPDX license expression
$ NODE_ICU_DATA='node_modules/full-icu' nyc mocha test/test
: No such file or directory
full log: https://travis-ci.com/njzjz/chemicaltools-js/jobs/190964352
But it worked fine before.
Sent from PPHub For GitHub
About this issue
- Original URL
- State: closed
- Created 5 years ago
- Reactions: 7
- Comments: 24 (13 by maintainers)
Commits related to this issue
- build(npm): :arrow_down: mocha build breaks on node 6 due to https://github.com/mochajs/mocha/issues/3866 using 6.0.2 until that is fixed, or node 6 is de-supported whichever comes first — committed to sverweij/dependency-cruiser by sverweij 5 years ago
- pin mocha to 6.0.2 mochajs/mocha#3866 broke tests on Node v6 — committed to borisovg/node-websocket by borisovg 5 years ago
- update deps, but pin mocha to 6.0 because of https://github.com/mochajs/mocha/issues/3866 — committed to photostructure/exiftool-vendored.js by mceachen 5 years ago
Since mocha is already using prettier, the easy fix would be to change the prettier config in
package.json
to enforce specific line endings instead of just keeping whatever is there, and to ensure that prettier gets run before publishing…@kevinoid I personally use latest
yarn@1.15.2
and it breaks there…I just ran into this too. If you just run
mocha
without anything wrapping it the problem becomes clearer:It seems the package was published with CRLF line endings, which will cause issues on non-windows platforms:
@AlexZeitler thank you for your confirmation!
The problem was the
npm publish
command run on Windows produced a tarball that could not run on Linux. I don’t think the smoke test deals with that.On Sun, Apr 7, 2019, 6:24 PM Matthew McEachen notifications@github.com wrote:
@mceachen Thanks, we have windows tests on appveyor. It seems pushing to github was fine, just
npm publish
went wrong.Came here to suggest the gitattributes approach as well. It’ll force LF checkouts on all platforms; I add one religiously to all new projects.
* text=auto EOL=LF
EDIT: also add an editorconfig forcing LF line endings if you haven’t already.