Skip to content

[BUG] npm install doesn't create the .bin directory with a v6 package-lock #2147

Description

@closingin

Hello there, here's a little (but really annoying) bug I just found out !

Current Behavior:

I just upgraded to node@15 and npm@7.

When deleting my node_modules and reinstalling using npm i, npm doesn't create the .bin directory, which ends up in me having no working scripts at all (eg: npm run build, supposed to run next build, but it can't find it obviously).

If I delete my current package-lock.json and reinstall, the .bin directory is correctly re-created, but I can't do that as it breaks my app.

npm bin correctly returns [redacted]/node_modules/.bin.

From what I can see in my git diff, my old package-lock.json does not have the "bin": {} property on packages that have binaries, while the fresh one has it.

Expected Behavior:

npm install should create and populate the .bin directory with older package-lock.json files, and upgrade the lock file.

Steps To Reproduce:

Having a v6 package-lock I guess ? I don't know what's causing this, but I can give you my package-lock.json and package.json if needed.

Environment:

  • OS: Arch Linux
  • Node: 15.1.0
  • npm: 7.0.8 (the bug also exists in previous versions)

Metadata

Metadata

Assignees

No one assigned

    Labels

    Bugthing that needs fixingRelease 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