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
When Jenkins runs the stage in Docker agent it usually sets HOME=/ (image WORKDIR value), but Jenkins user does not have write permissions in this directory, that's why npm cannot create its cache directory ~/.npm. To solve this you need either to override HOME or NPM default cache directory:
environment {
// Override HOME to WORKSPACE
HOME = "${WORKSPACE}"
// or override default cache directory (~/.npm)
NPM_CONFIG_CACHE = "${WORKSPACE}/.npm"
}