mirror of
https://github.com/zulip/zulip.git
synced 2025-11-03 13:33:24 +00:00
install-node: hardcode the path for npm.
This replaces nvm in npm-wrapper by harcoding the path the way we do with node. The main benefit is that this saves a few hundred milliseconds every time we invoke npm.
This commit is contained in:
@@ -11,6 +11,7 @@ source "$NVM_DIR/nvm.sh"
|
||||
node_version=6.6.0
|
||||
nvm install "$node_version" && nvm alias default "$node_version"
|
||||
export NODE_BIN="$(nvm which default)"
|
||||
export NPM_BIN=$(echo "$NODE_BIN" | sed 's/node$/npm/')
|
||||
|
||||
# Fix messed-up uid=500 and group write bits produced by nvm
|
||||
n=$(which node)
|
||||
@@ -22,3 +23,4 @@ chmod -R go-w "$n"
|
||||
cp "$ZULIP_PATH/../../scripts/setup/node-wrapper" /usr/local/bin/node
|
||||
sed -i "s|NODE_PATH|$NODE_BIN|" /usr/local/bin/node
|
||||
cp "$ZULIP_PATH/../../scripts/setup/npm-wrapper" /usr/local/bin/npm
|
||||
sed -i "s|NPM_PATH|$NPM_BIN|" /usr/local/bin/npm
|
||||
|
||||
@@ -1,4 +1,2 @@
|
||||
#!/bin/bash
|
||||
export NVM_DIR="/usr/local/nvm"
|
||||
[ -e "$NVM_DIR/nvm.sh" ] && . "$NVM_DIR/nvm.sh"
|
||||
npm "$@"
|
||||
NPM_PATH "$@"
|
||||
|
||||
Reference in New Issue
Block a user