build-system: node: Use file:// prefix for local dependencies.

Using the file:// prefix for local packages was always allowed, and since npm
version 11 required in order to properly resolve local dependencies when
installing from tarballs.

* guix/build/node-build-system.scm (index-modules): Add "file://" prefix to
hash table values for local modules.

Change-Id: I9d95a5d6788cc918b94677b4524391617e3a73b4
This commit is contained in:
Jelle Licht 2025-10-13 11:15:26 +02:00
parent f7a735d270
commit c4b3208deb
No known key found for this signature in database
GPG key ID: DA4597F947B41025

View file

@ -213,7 +213,8 @@ only after the 'patch-dependencies' phase."
(for-each (lambda (dir)
(let ((nm (string-append dir "/lib/node_modules")))
(for-each (lambda (module)
(hash-set! index (module-name module) module))
(hash-set! index (module-name module)
(string-append "file://" module)))
(list-modules nm))))
input-paths)
index))