Skip to content

Conversation

matthewhughes934
Copy link
Contributor

Because I just spent far too much time trying to figure out why npm install added carriage returns to package-lock.json and then git would complain:

warning: in the working copy of 'package-lock.json', CRLF will be
replaced by LF the next time Git touches it

This is simply the result of running:

git add --renormalize package.json

Since the attributes on that file set line endings to simply \n:

$ git check-attr -a package.json
package.json: text: auto
package.json: eol: lf

@matthewhughes934 matthewhughes934 requested a review from a team as a code owner July 30, 2025 19:14
Because I just spent far too much time trying to figure out why `npm
install` added carriage returns to `package-lock.json` and then `git`
would complain:

> warning: in the working copy of 'package-lock.json', CRLF will be
replaced by LF the next time Git touches it

This is simply the result of running:

    git add --renormalize package.json

Since the attributes on that file set line endings to simply `\n`:

    $ git check-attr -a package.json
    package.json: text: auto
    package.json: eol: lf
@matthewhughes934 matthewhughes934 force-pushed the fix-package-json-line-endings branch from 8278a8e to 2fa5708 Compare August 13, 2025 18:19
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

Successfully merging this pull request may close these issues.

1 participant