I run Windows, and when npm modifies my package.json file, it writes it using Unix-style line endings (LF). I want it to use Windows-style line endings (CRLF).
Is there a global config setting, or even a command-line option to make npm use the correct EOL characters?
Update: The even easier fix is to use [email protected] or newer.
Assuming Git, the easiest "solution" to this problem is to use a .gitattributes
file to specify that package.json
(and now package-lock.json
) should always use LF:
# .gitattributes in project root
package.json text eol=lf
package-lock.json text eol=lf
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With