Created
December 20, 2017 11:47
-
-
Save DMeechan/2f6e962622c3387785bb2e44298a153c to your computer and use it in GitHub Desktop.
Updating Node.js on IBM Cloud Delivery Pipeline
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# Credit: http://gh-blog.mybluemix.net/blogs/cokeSchlumpf/rethink-it/posts/bluemix/node-buildpipeline.md?cm_sp=dw-bluemix-_-nospace-_-answers | |
# Paste the script below into IBM Cloud Delivery Pipeline Build process (shell script) | |
# Set your Node and NVM version: | |
export NODE_VERSION=8.9.3 | |
export NVM_VERSION=0.33.8 | |
export NVM_DIR=/home/pipeline/nvm | |
METEOR_HOME=.meteor/local | |
PATH=$METEOR_HOME/usr/bin:$METEOR_HOME/usr/lib/meteor/bin:$PATH | |
update_node() { | |
npm config delete prefix \ | |
&& curl https://raw.githubusercontent.com/creationix/nvm/v${NVM_VERSION}/install.sh | sh \ | |
&& . $NVM_DIR/nvm.sh \ | |
&& nvm install $NODE_VERSION \ | |
&& nvm alias default $NODE_VERSION \ | |
&& nvm use default \ | |
&& node -v \ | |
&& npm -v | |
npm install | |
} |
I assure you that is not the case. Just crazy growing pains... The team had to freeze the versions to prevent breaking existing pipelines. A new approach to managing this stuff is coming out shortly.
@skaegi The currently highest pre-installed version is reaching its end of life in April this year. Might be a nice deadline for the new approach to see a release 😉
I ran into the same problem of needing a newer version to compile. Here is the beginning of my npm build script that installs the version of node and npm I need.
#!/bin/bash
#install n module to $HOME/.npm-global/bin/n
export PREFIX=./
npm install -g n
ls -l $HOME/.npm-global/bin
#install node to ./node/8.9.3
export N_PREFIX=$PWD/node
$HOME/.npm-global/bin/n 8.9.3
ls -l $N_PREFIX/n/versions/node
#set node path
export PATH=$N_PREFIX/n/versions/node/8.9.3/bin:$PATH
#set npm version
npm install -g npm@5.6.0
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I can't believe that the highest version available today is 6.x... It really feels like if IBM had abandoned the service since the current node version (LTS and L) are way higher.