Bluemix build pipeline set node and npm version

前端 未结 2 1739
醉梦人生
醉梦人生 2021-01-21 10:58

I want to deploy an angular 2 app on bluemix. The code is located at github and i want to deploy my app when i push something. So i created a pipeline. First the build pipeline

2条回答
  •  离开以前
    2021-01-21 11:51

    The answer above pointed me in the right direction, but newer versions of NVM wouldn't work. NVM's install.sh now checks if NVM_DIR is set but the directory doesn't exist.

    I changed the NVM_DIR path and declared it after install.sh has completed.

    bash
    #!/bin/bash
    
    export NODE_VERSION=8
    export NVM_VERSION=0.33.11
    
    npm config delete prefix \
      && curl -o- https://raw.githubusercontent.com/creationix/nvm/v${NVM_VERSION}/install.sh | bash \
      && export NVM_DIR="$HOME/.nvm" \
      && . $NVM_DIR/nvm.sh \
      && nvm install $NODE_VERSION \
      && nvm alias default $NODE_VERSION \
      && nvm use default \
      && node -v \
      && npm -v
    

提交回复
热议问题