-
Notifications
You must be signed in to change notification settings - Fork 3.2k
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] bin files are lost when installing on a v1 lockfile, and can only be retained by regenerating entire lock #1957
Comments
Encountered the same issue. A workaround for me was to trigger lock file migration using EDIT: I did the dedupe that after the removal of the I did a comparison of both lock files (the one I get with ❯ node -v
v14.14.0
❯ npm -v
7.0.5 |
Same problem here. It seems that some of |
I've just come across this now, and running Edit: that seemed to work for me locally but for me to get it to work in CI I needed to delete node_modules and package-lock.json and reinstall too |
@mizukami234 just to be clear, I did that after deleting |
I'm trying to narrow this down. If I install an entirely new dependency which has The
Looks like the old version didn't bother recording "bin" data, so the migration doesn't have a way to translate it and just leaves it out, but the new version won't install binaries unless the "bin" section is present in package-lock.json (seems to be some aggressive caching). I'd suggest the best fix would be to provide an explicit "there are no binaries" record (e.g. a "bin" entry with an empty list), so that absence means "check this" rather than "do nothing". |
When migrating from package-lock v1 -> v2 in a project that currently has an actual tree + a package-lock file the reify process fails to properly update the package-lock with the bins info. This fixes it by setting build-ideal-tree to always inflate old lockfiles even if `complete: true` isn't set. Fixes: npm/cli#1957
When migrating from package-lock v1 -> v2 in a project that currently has an actual tree + a package-lock file the reify process fails to properly update the package-lock with the bins info. This fixes it by setting build-ideal-tree to always inflate old lockfiles even if `complete: true` isn't set. Fixes: npm/cli#1957
A word to folks that contributed to this fix, we fixed the problem at the origin of this issue so that the migration from lockfile v1 -> v2 will not drop the # Make sure you got npm@7.0.11 or newer:
$ npm install -g npm@7
# npm@6 install:
$ npx npm@6 install
# npm@7 install to migrate package-lock file again:
$ npm install
# You should have a fixed-up package-lock.json file now :) |
also needed to update the node version to get a newer version of npm, and regenerate the package-lock because of an npm 7 issue npm/cli#1957
There was a bug in an earlier version of `npm@7` that causes some information about bins and engines to be lost when upgrading from lock file version 1 to 2, as was done in 0d1e40b. See npm/cli#1957 This has since been fixed with npm/arborist@a49d3fb This commit contains the regenerated lockfile from before 0d1e40b, which has been fixed with `npm@7.3.0`, using the instructions at npm/cli#1957 (comment) Additionally, `markdownlint-cli` is removed, which should have been done in 0d1e40b
Running
npm i
with a lock file that haslockfileVersion: 1
seems to not pull in the bin details for at least some packages, meaning the.bin
folder is not generated.If I remove both
package-lock.json
&node_modules
,npm i
generates the expected lock that has thebin
property, but this results in dependencies being upgraded which means more work for me since that can have all kinds of knock on effects (eslint plugin changes, security, etc).Current Behavior:
No
.bin
folder exists.package-lock.json:
Expected Behavior:
The
.bin
folder exists, withtsc
in it.package-lock.json:
Steps To Reproduce:
Run the following in a new folder:
Example:
Environment:
The text was updated successfully, but these errors were encountered: