mirror of https://github.com/zulip/zulip.git
install-node: Correctly fix yarn installation.
Apparently, new versions of yarn use the HOME environment variable to
figure out where to access their configuration, and sudo apparently
doesn't clear that variable, so install-node was being run with HOME
set to something under /home/vagrant (e.g.).
Fix this by just setting that environment variable correctly.
This replaces 250a036ff8
, which
misdiagnosed the issue.
This commit is contained in:
parent
205bcb8ef9
commit
f6ae57fa70
|
@ -41,6 +41,11 @@ if [ "$current_node_version" != "v$node_version" ]; then
|
||||||
sed -i "s|NODE_PATH|$NODE_BIN|" /usr/local/bin/node
|
sed -i "s|NODE_PATH|$NODE_BIN|" /usr/local/bin/node
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
# Work around the fact that apparently sudo doesn't clear the HOME
|
||||||
|
# environment variable in some cases; we don't want root
|
||||||
|
# accessing/storing yarn configuration in the non-root user's home
|
||||||
|
# directory.
|
||||||
|
export HOME=/root
|
||||||
|
|
||||||
# Install yarn if not installed
|
# Install yarn if not installed
|
||||||
bash "$ZULIP_PATH/scripts/lib/third/install-yarn.sh" "$ZULIP_SRV" --version "$yarn_version"
|
bash "$ZULIP_PATH/scripts/lib/third/install-yarn.sh" "$ZULIP_SRV" --version "$yarn_version"
|
||||||
sudo chown -R "$(whoami)" "$HOME/.config/yarn"
|
|
||||||
|
|
Loading…
Reference in New Issue