title: npm install error for Jhipster CI-CD jenkins pipeline
body: <p>I am trying to use jhipster ci-cd to create Jenkins pipeline.</p>
  
  <p>But when I am running the jenkins pipeline in Jenkins server, I am getting following error.</p>
  
  <p>Note : My jenkins server is a Jenkins instance running on Ubuntu EC2 instance [ NOT DOCKERISED JENKINS ]</p>
  
  <p>Attaching the Jenkinsfile for reference.</p>
  
  <p>Jenkinsfile.txt</p>
  
  <pre><code>./mvnw -ntp com.github.eirslett:frontend-maven-plugin:npm
  [INFO] Scanning for projects...
  [INFO]
  [INFO] --------------------&lt; com.jhip.poc:jhipprojectmono &gt;--------------------
  [INFO] Building Jhipprojectmono 0.0.1-SNAPSHOT
  [INFO] --------------------------------[ jar ]---------------------------------
  [INFO]
  [INFO] --- frontend-maven-plugin:1.8.0:npm (default-cli) @ jhipprojectmono ---
  [INFO] Running 'npm install' in /var/lib/jenkins/workspace/jhipprojectmono
  [INFO] npm ERR! correctMkdir failed to make directory /.npm/_locks
  [INFO] npm ERR! code EACCES
  [INFO] npm ERR! syscall mkdir
  [INFO] npm ERR! path /.npm
  [INFO] npm ERR! errno -13
  [INFO] npm ERR!
  [INFO] npm ERR! Your cache folder contains root-owned files, due to a bug in
  [INFO] npm ERR! previous versions of npm which has since been addressed.
  [INFO] npm ERR!
  [INFO] npm ERR! To permanently fix this problem, please run:
  [INFO] npm ERR! sudo chown -R 111:115 "/.npm"
  [INFO] ------------------------------------------------------------------------
  [INFO] BUILD FAILURE
  [INFO] ------------------------------------------------------------------------
  [INFO] Total time: 14.723 s
  [INFO] Finished at: 2020-02-19T14:33:40Z
  [INFO] ------------------------------------------------------------------------
  [ERROR] Failed to execute goal com.github.eirslett:frontend-maven-plugin:1.8.0:npm (default-cli) on project jhipprojectmono: Failed to run task: 'npm install' failed. org.apache.commons.exec.ExecuteException: Process exited with an error: 243 (Exit value: 243) -&gt; [Help 1]
  [ERROR]
  [ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
  [ERROR] Re-run Maven using the -X switch to enable full debug logging.
  [ERROR]
  [ERROR] For more information about the errors and possible solutions, please read the following articles:
  [ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoFailureException
  </code></pre>
  
  <p>---------- Jenkins file --------</p>
  
  <pre><code>#!/usr/bin/env groovy
  
  node {
      stage('checkout') {
          checkout scm
      }
  
      //gitlabCommitStatus('build') {
      gitlabCommitStatus {
  
          docker.image('jhipster/jhipster:v6.5.1').inside('-e MAVEN_OPTS="-Duser.home=./"') {
          //docker.image('openjdk:8').inside('-u jhipster -e MAVEN_OPTS="-Duser.home=./"') {
  
              stage('path') {
                  sh "pwd"
                  sh "ls -ltr"
              }
              stage('check java') {
                  sh "java -version"
              }
  
              stage('clean') {
                  sh "chmod +x mvnw"
                  sh "./mvnw -ntp clean"
              }
              stage('nohttp') {
                  sh "./mvnw -ntp checkstyle:check"
              }
  
              stage('install tools') {
                  sh "./mvnw -ntp com.github.eirslett:frontend-maven-plugin:install-node-and-npm -DnodeVersion=v12.13.0 -DnpmVersion=6.13.0"
              }
  
              stage('npm install') {
                  sh "./mvnw -ntp com.github.eirslett:frontend-maven-plugin:npm"
              }
  
              stage('backend tests') {
                  try {
                      sh "./mvnw -ntp verify"
                  } catch(err) {
                      throw err
                  } finally {
                      junit '**/target/test-results/**/TEST-*.xml'
                  }
              }
  
              stage('frontend tests') {
                  try {
                      sh "./mvnw -ntp com.github.eirslett:frontend-maven-plugin:npm -Dfrontend.npm.arguments='run test'"
                  } catch(err) {
                      throw err
                  } finally {
                      junit '**/target/test-results/**/TEST-*.xml'
                  }
              }
  
              stage('packaging') {
                  sh "./mvnw -ntp verify -Pprod -DskipTests"
                  archiveArtifacts artifacts: '**/target/*.jar', fingerprint: true
              }
          }
  
          def dockerImage
          stage('publish docker') {
              // A pre-requisite to this step is to setup authentication to the docker registry
              // https://github.com/GoogleContainerTools/jib/tree/master/jib-maven-plugin#authentication-methods
              sh "./mvnw -ntp jib:build"
          }
      }
  }
  </code></pre>