modified guix/build/node-build-system.scm @@ -1,6 +1,7 @@ ;;; GNU Guix --- Functional package management for GNU ;;; Copyright © 2015 David Thompson ;;; Copyright © 2016 Jelle Licht +;;; Copyright © 2018 swedebugia ;;; ;;; This file is part of GNU Guix. ;;; @@ -108,9 +109,13 @@ is an npm global install." (#f #f)))) (mkdir-p tgt-dir) (copy-recursively "." (string-append tgt-dir "/node_modules/" modulename)) - ;; Remove references to dependencies - (delete-file-recursively - (string-append tgt-dir "/node_modules/" modulename "/node_modules")) + ;; Remove references to bundled dependencies + (let ((tgt-node-modules (string-append tgt-dir + "/node_modules/" modulename "/node_modules"))) + ;; Check if tgt-node-modules exist and remove them if #t + (when (file-is-directory? tgt-node-modules) + (delete-file-recursively + tgt-node-modules))) (when global? (cond ((string? bin-conf)