From 92f1fa8f894397669dc14675becd7c9eca9a4683 Mon Sep 17 00:00:00 2001 From: AJ ONeal Date: Mon, 27 Apr 2020 06:42:26 +0000 Subject: [PATCH] workaround npm bug/"feature" --- node/node.bash | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/node/node.bash b/node/node.bash index 13ce558..33a9abb 100644 --- a/node/node.bash +++ b/node/node.bash @@ -103,11 +103,15 @@ echo "" rm -rf "${NODEJS_UNTAR}" chown -R $(whoami) "$node_install_path/lib/node_modules/" 2>/dev/null || $sudo_cmd chown -R $(whoami) "$node_install_path/lib/node_modules/" -chown $(whoami) ""$node_install_path"/bin/" 2>/dev/null || $sudo_cmd chown $(whoami) ""$node_install_path"/bin/" +chown $(whoami) "$node_install_path"/bin/ 2>/dev/null || $sudo_cmd chown $(whoami) "$node_install_path"/bin/ mkdir -p $node_install_path/lib/node_modules 2> /dev/null || $sudo_cmd mkdir -p $node_install_path/lib/node_modules chown -R $(whoami) $node_install_path/lib/node_modules 2> /dev/null || $sudo_cmd chown -R $(whoami) $node_install_path/lib/node_modules +# By default, npm is stupid and uses any version of node in any path. Stop that. +# npm config set scripts-prepend-node-path true +"$node_install_path"/bin/node "$node_install_path"/bin/npm --scripts-prepend-node-path=true config set scripts-prepend-node-path true + ####### # END # ####### -- 2.25.1