Published on May 18, 2021
If you install an npm package using yarn and you get this error it means that the package author is using windows line endings and node on mac can’t run the script as expected.
env: node\r: No such file or directory
To fix it you need to change the line endings. But you need to ensure this happens after each install of packages!
Note: You won’t get this error if you use npm because npm automatically processes the line endings for you!
The trick for us yarn users is to use the
crlf package to modify the line endings for the package.
You can add a script to the prepare script. This will be run after every install.
"prepare": "npx crlf --set=LF node_modules/.bin/jira-prepare-commit-msg"
Hi! I'm Darragh ORiordan.
I live and work in Sydney, Australia enjoying the mountains and the ocean.
I build and support happy teams that create high quality software for the web.
Contact me on Twitter!