Update install.sh to temporarily edit the `PATH` to ensure correct `node` and `npm` versions are used during installation.

This commit is contained in:
richdex14 2017-09-07 10:30:18 -06:00
parent 76193b3822
commit 34621cf288
1 changed files with 13 additions and 1 deletions

View File

@ -77,19 +77,31 @@ install_walnut()
# Now that the install is finished we need to set the owner to the user that will actually
# be running the walnut server.
$sudo_cmd chown -R www-data:www-data /srv/walnut || $sudo_cmd chown -R _www:_www /srv/walnut
}
}
# Install node
echo "----Installing Nodejs and NPM----"
echo "v8.2.1" > /tmp/NODEJS_VER
daplie-install-node-dev
npm install -g npm@4
# Install goldilocks
echo "----Installing goldilocks.js----"
daplie-install-goldilocks
echo "----Installing walnut.js----"
#$sudo_cmd mkdir -p /opt/goldilocks/{lib,bin,etc}
#export NODE_PATH=/opt/walnut/lib/node_modules
#export NPM_CONFIG_PREFIX=/opt/walnut
old_PATH=$PATH
export PATH=/opt/walnut/bin:$PATH
# Install walnut
install_walnut
# Restore PATH to original value
export PATH=$old_PATH
echo ""
echo "You must have some set of domain set up to properly use goldilocks+walnut:"
echo ""