nix-community / napalm

Support for building npm packages in Nix and lightweight npm registry [maintainer=?]
MIT License
104 stars 17 forks source link

Fails on lockfileVersion: 3 #55

Closed kevincox closed 11 months ago

kevincox commented 1 year ago

When running there are many errors of the following form as well as a lot of gobbledygook as it appears that multiple messages are being character-by-character concurrently.

No such tarball
CallStack (from HasCallStack):
  error, called at Main.hs:212:8 in main:Main
No such tarball

To reproduce:

  1. Download https://gitlab.com/kevincox/filepush/-/commit/08f97910ef4d8e99fa1878938ecd2c2edea1398d as a publicly-available example. (Exact commit is not relevant, just pinning a reference)
  2. Run nix-build and observe that it succeeds.
  3. Run npm install--lockfile-version 3 --package-lock-only.
  4. Run nix-build and observe that it fails.
kevincox commented 1 year ago

Unless you need a v3 lockfile this can be worked around by downgrading the lockfile:

npm install --lockfile-version 2 --package-lock-only

It seems that current versions of npm default to a v3 lockfile but will not upgrade from v2 to v3 automatically.

mdarocha commented 1 year ago

Done in https://github.com/nix-community/napalm/pull/58