Change node installation
This commit is contained in:
parent
86d5e5d696
commit
4a67b64d35
|
@ -61,7 +61,7 @@ PATH="/usr/bin:/usr/sbin:/usr/local/bin:/usr/local/sbin:/bin"
|
|||
NODE_PATH="/usr/lib/node_modules"
|
||||
cp /usr/bin/nodejs /usr/local/bin/node
|
||||
cp /usr/bin/nodejs /usr/bin/node
|
||||
/usr/bin/curl -0 -L https://npmjs.org/install.sh | sh
|
||||
#/usr/bin/curl -0 -L https://npmjs.org/install.sh | sh
|
||||
npm install -g n@${NODEJS_N_VERSION} --save
|
||||
n ${NODEJS_VERSION}
|
||||
exit 0
|
||||
|
@ -152,13 +152,9 @@ function install_nodejs {
|
|||
exit 63962
|
||||
fi
|
||||
|
||||
cat <<EOF > /root/install-nodejs.sh
|
||||
#!/bin/bash
|
||||
PATH="/usr/bin:/usr/sbin:/usr/local/bin:/usr/local/sbin:/bin"
|
||||
NODE_PATH="/usr/lib/node_modules"
|
||||
cp /usr/bin/nodejs /usr/local/bin/node
|
||||
cp /usr/bin/nodejs /usr/bin/node
|
||||
/usr/bin/curl -0 -L https://npmjs.org/install.sh | sh
|
||||
|
||||
npm install -g n@${NODEJS_N_VERSION} --save
|
||||
if [ ! -f /usr/local/bin/n ]; then
|
||||
exit 1
|
||||
|
@ -178,15 +174,6 @@ cp /usr/local/bin/npm /usr/bin/npm
|
|||
npm install -g pug@2.0.0-beta6 --save
|
||||
npm install -g graceful-fs@4.1.10 --save
|
||||
npm install -g minimatch@3.0.3 --save
|
||||
exit 0
|
||||
EOF
|
||||
chmod +x /root/install-nodejs.sh
|
||||
/root/install-nodejs.sh
|
||||
if [ ! "$?" = "0" ]; then
|
||||
rm -f /root/install-nodejs.sh
|
||||
exit 7632572
|
||||
fi
|
||||
rm -f /root/install-nodejs.sh
|
||||
|
||||
# second npm install attempt seems necessary
|
||||
npm install -g npm@${NPM_VERSION} --save
|
||||
|
|
Loading…
Reference in New Issue