Skip to content

[BUG] package.json and package-lock.json order is different when used Czech locale #2829

Description

@jakubjosef

Current Behavior:

package-lock and package.json order is different when used non English (Czech) locale

Expected Behavior:

Sorting should be locale-agnostic to not change package-lock JSON back and forth.

Steps To Reproduce:

  1. Clone repo created with English locale
  2. Run npm install
  3. I see different order for packages with ch in name (eg. chai)

Environment:

  • OS: macOS 11.2.2
  • Node: 14.16.0
  • npm: 7.6.1

It looks like similar problem as it's reported here
npm/npm#17048

I think the root cause is different order of letters. In Czech alphabet CH letter stands after H, but in English alphabet it's just C.

Example in package.json (left is Czech locale, right is English)

image

Workaround

If someone is facing the same issue in can be fixed by defining alias alias npm='LANG="en_US.UTF-8" LC_ALL="en_US.UTF-8" npm' in bash_profile/.zshrc or similar file depends to shell you are using.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

Bugthing that needs fixingPriority 2secondary priority issueRelease 7.xwork is associated with a specific npm 7 release

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions