guix_mirror_bot pushed a commit to branch master
in repository guix.

commit dcb19507b64b9a28e30c00a94f98cc6aedb1b4c0
Author: Jelle Licht <[email protected]>
AuthorDate: Thu Oct 15 13:07:38 2026 +0200

    build/node: Configure npm through environment variables.
    
    Set options once in the environment instead of passing them to each npm
    invocation so that all npm commands including ones run by packages behave
    consistently.
    
    * guix/build/node-build-system.scm (set-home): Set 
npm_config_update_notifier,
    npm_config_fund, npm_config_fetch_retries, npm_config_audit,
    npm_config_ignore_scripts and npm_config_offline.
    (configure): Remove '--offline', '--ignore-scripts' and '--no-audit'.
    (install): Remove '--offline'.
---
 guix/build/node-build-system.scm | 13 +++++++------
 1 file changed, 7 insertions(+), 6 deletions(-)

diff --git a/guix/build/node-build-system.scm b/guix/build/node-build-system.scm
index 67fc05d8e05..0ef1aff0dbc 100644
--- a/guix/build/node-build-system.scm
+++ b/guix/build/node-build-system.scm
@@ -136,6 +136,12 @@ dependencies."
             (begin
               (mkdir dir)
               (setenv "HOME" (string-append (getcwd) "/" dir))
+              (setenv "npm_config_update_notifier" "false")
+              (setenv "npm_config_fund" "false")
+              (setenv "npm_config_fetch_retries" "0")
+              (setenv "npm_config_audit" "false")
+              (setenv "npm_config_ignore_scripts" "true")
+              (setenv "npm_config_offline" "true")
               (format #t "set HOME to ~s~%" (getenv "HOME"))))))))
 
 (define (module-name module)
@@ -202,11 +208,7 @@ dependencies."
 
 (define* (configure #:key inputs #:allow-other-keys)
   (let ((npm (string-append (assoc-ref inputs "node") "/bin/npm")))
-    (invoke npm "--offline"
-            "--ignore-scripts"
-            "--install-links"
-            "--no-audit"
-            "install")))
+    (invoke npm "--install-links" "install")))
 
 (define* (build #:key inputs #:allow-other-keys)
   (let* ((package-meta (call-with-input-file "package.json" json->scm))
@@ -239,7 +241,6 @@ dependencies."
         (npm (string-append (assoc-ref inputs "node") "/bin/npm")))
     (invoke npm "--prefix" out
             "--global"
-            "--offline"
             "--loglevel" "info"
             "--production"
             "--install-links"

Reply via email to