npm install fails in jenkins pipeline in docker

前端 未结 12 921
野性不改
野性不改 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

    Adding the environments and setting the Home to '.' solves this as below.

    pipeline {
        agent { docker { image 'node:8.12.0' } }
        environment {
            HOME = '.'
        }
        stages {
            stage('Clone') {
                steps {
                    git branch: 'master',
                        credentialsId: '121231k3jkj2kjkjk',
                        url: 'https://myserver.com/my-repo.git'
                }
            }
            stage('Build') {
                steps {
                    sh "npm install"
                }
            }
        }
    }
    

提交回复
热议问题