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

Feature request: support for npm lockfile version 3 #76

Open
hlolli opened this issue Jun 1, 2023 · 3 comments
Open

Feature request: support for npm lockfile version 3 #76

hlolli opened this issue Jun 1, 2023 · 3 comments

Comments

@hlolli
Copy link
Contributor

hlolli commented Jun 1, 2023

nodejs18 comes with npm 9.x which produces lockfile version 3, which produces

error: nix-npm-buildPackage doesn't support this lock file version

I don't know how heavy lift this will be, I just noticed that there wasn't any ticket here around this upcoming change.

Workaround: just re-enumerate 3 to 2 in the package-lock.json, seems to work.

@terlar
Copy link
Contributor

terlar commented Jun 1, 2023

I forgot about the implementation, but it depends on how we use the lock-format I think. So first there was V1 and then there was V2, which added a new way to define dependencies but kept the V1 format around. Then now in V3 they dropped the legacy one, so you get a smaller lock file with only the new format.

@hlolli
Copy link
Contributor Author

hlolli commented Jun 1, 2023

it seems V3 suffers from the same npm/cli#4263 issue as V2. And my workaround to nuke the npm cache and re-fetch everything, is at least on initial attempt, not working. So I do NIXPKGS_ALLOW_INSECURE=1 nix-shell -p nodejs-16_x to regenerate the lockfile then go back as usual to nodejs18.

@kodeFant
Copy link

kodeFant commented Jul 8, 2023

A workaround I use is to create an .npmrc that forces the lockfile version to be kept at version 2:

lockfile-version=2

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

3 participants