Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUG] npm converts tabs to spaces if used in package.json #1285

Closed
Newbytee opened this issue May 13, 2020 · 2 comments
Closed

[BUG] npm converts tabs to spaces if used in package.json #1285

Newbytee opened this issue May 13, 2020 · 2 comments

Comments

@Newbytee
Copy link

What / Why

If one uses tabs to indent their package.json file, npm will overwrite these tabs with spaces. It does not warn you that you used tabs instead of spaces, and the documentation for package.json does not mention how it should be indented.

When

  • When an npm command is issued that mutates package.json (for example, installing a package).

Where

  • n/a

How

Current Behavior

  • npm will replace tabs with spaces as it mutates package.json.

Steps to Reproduce

  • Write a skeleton package.json using tabs for indentation
  • Install a package
  • Observe that the tabs have been replaced by spaces (1 space for each tab)

Expected Behavior

  • npm sees that package.json is indented with tabs and continues to indent with tabs.

Who

  • n/a

References

  • n/a
@ljharb
Copy link
Contributor

ljharb commented May 13, 2020

What version of npm are you using? In my experience this long-standing bug was fixed in npm 6.

@Newbytee
Copy link
Author

Hmm, seems I can't reproduce it now. Maybe I forgot some space somewhere.

For the record, I'm using npm 6.14.4.

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

No branches or pull requests

2 participants