npm install fails in jenkins pipeline in docker

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

    from https://github.com/jenkins-infra/jenkins.io/blob/master/Jenkinsfile

    docker.image('openjdk:8').inside {
        /* One Weird Trick(tm) to allow git(1) to clone inside of a
        * container
        */
        withEnv([
            /* Override the npm cache directory to avoid: EACCES: permission denied, mkdir '/.npm' */
            'npm_config_cache=npm-cache',
            /* set home to our current directory because other bower
            * nonsense breaks with HOME=/, e.g.:
            * EACCES: permission denied, mkdir '/.config'
            */
            'HOME=.',
        ]) {
                // your code
        }
    }
    

提交回复
热议问题