npm install fails in jenkins pipeline in docker

前端 未结 12 909
野性不改
野性不改 2020-12-07 17:45

I\'m following a tutorial about Jenkins pipeline and I can get a \"hello world\" working under at node 6.10 docker container.

But, when I added a default EmberJS app

12条回答
  •  轻奢々
    轻奢々 (楼主)
    2020-12-07 18:23

    You can install nvm on the fly before building, in a local directory with NVM_DIR without setting it as global dependency :

    mkdir -p node_dir
    export NVM_DIR=$(pwd)/node_dir
    curl https://raw.githubusercontent.com/creationix/nvm/v0.33.1/install.sh | bash
    source $(pwd)/node_dir/nvm.sh
    nvm install 7
    nvm use 7
    

    The new locations are :

    $ which node
    ~/someDir/node_dir/versions/node/v7.7.2/bin/node
    
    $ which npm
    ~/someDir/node_dir/versions/node/v7.7.2/bin/npm
    

提交回复
热议问题