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 npm@5.8.0 or newer.
Assuming Git, the easiest "solution" to this problem is to use a
.gitattributes
file to specify thatpackage.json
(and nowpackage-lock.json
) should always use LF: