From: AJ ONeal Date: Mon, 27 Apr 2020 06:42:26 +0000 (+0000) Subject: workaround npm bug/"feature" X-Git-Url: https://git.josue.xyz/?p=webi-installers%2F.git;a=commitdiff_plain;h=92f1fa8f894397669dc14675becd7c9eca9a4683 workaround npm bug/"feature" --- 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 # #######