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"
|
NODE_PATH="/usr/lib/node_modules"
|
||||||
cp /usr/bin/nodejs /usr/local/bin/node
|
cp /usr/bin/nodejs /usr/local/bin/node
|
||||||
cp /usr/bin/nodejs /usr/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
|
npm install -g n@${NODEJS_N_VERSION} --save
|
||||||
n ${NODEJS_VERSION}
|
n ${NODEJS_VERSION}
|
||||||
exit 0
|
exit 0
|
||||||
|
@ -152,41 +152,28 @@ function install_nodejs {
|
||||||
exit 63962
|
exit 63962
|
||||||
fi
|
fi
|
||||||
|
|
||||||
cat <<EOF > /root/install-nodejs.sh
|
cp /usr/bin/nodejs /usr/local/bin/node
|
||||||
#!/bin/bash
|
cp /usr/bin/nodejs /usr/bin/node
|
||||||
PATH="/usr/bin:/usr/sbin:/usr/local/bin:/usr/local/sbin:/bin"
|
|
||||||
NODE_PATH="/usr/lib/node_modules"
|
npm install -g n@${NODEJS_N_VERSION} --save
|
||||||
cp /usr/bin/nodejs /usr/local/bin/node
|
if [ ! -f /usr/local/bin/n ]; then
|
||||||
cp /usr/bin/nodejs /usr/bin/node
|
exit 1
|
||||||
/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
|
|
||||||
fi
|
|
||||||
cp /usr/local/bin/n /usr/bin/n
|
|
||||||
n ${NODEJS_VERSION}
|
|
||||||
if [ ! -f /usr/local/bin/node ]; then
|
|
||||||
exit 2
|
|
||||||
fi
|
|
||||||
cp /usr/local/bin/node /usr/bin/nodejs
|
|
||||||
cp /usr/local/bin/node /usr/bin/node
|
|
||||||
npm install -g npm@${NPM_VERSION} --save
|
|
||||||
if [ ! -f /usr/local/bin/npm ]; then
|
|
||||||
exit 3
|
|
||||||
fi
|
|
||||||
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
|
fi
|
||||||
rm -f /root/install-nodejs.sh
|
cp /usr/local/bin/n /usr/bin/n
|
||||||
|
n ${NODEJS_VERSION}
|
||||||
|
if [ ! -f /usr/local/bin/node ]; then
|
||||||
|
exit 2
|
||||||
|
fi
|
||||||
|
cp /usr/local/bin/node /usr/bin/nodejs
|
||||||
|
cp /usr/local/bin/node /usr/bin/node
|
||||||
|
npm install -g npm@${NPM_VERSION} --save
|
||||||
|
if [ ! -f /usr/local/bin/npm ]; then
|
||||||
|
exit 3
|
||||||
|
fi
|
||||||
|
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
|
||||||
|
|
||||||
# second npm install attempt seems necessary
|
# second npm install attempt seems necessary
|
||||||
npm install -g npm@${NPM_VERSION} --save
|
npm install -g npm@${NPM_VERSION} --save
|
||||||
|
|
Loading…
Reference in New Issue