workaround npm bug/"feature"

This commit is contained in:
AJ ONeal
2020-04-27 06:42:26 +00:00
parent c56bd0449d
commit 92f1fa8f89

View File

@@ -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 #
#######