eirslett / frontend-maven-plugin

"Maven-node-grunt-gulp-npm-node-plugin to end all maven-node-grunt-gulp-npm-plugins." A Maven plugin that downloads/installs Node and NPM locally, runs NPM install, Grunt, Gulp and/or Karma.
Apache License 2.0
4.26k stars 869 forks source link

Node zombie processes left after mvn completes #718

Open lucastheisen opened 6 years ago

lucastheisen commented 6 years ago

Do you want to request a feature or report a bug? bug

What is the current behavior? running mvn install results in node zombie processes. one for each npm task in my pom

If the current behavior is a bug, please provide the steps to reproduce.

1) create a project with npm processes

      <plugin>
        <groupId>com.github.eirslett</groupId>
        <artifactId>frontend-maven-plugin</artifactId>
        <version>${frontend-maven-plugin.version}</version>
        <executions>
          <execution>
            <id>install node and npm</id>
            <goals>
              <goal>install-node-and-npm</goal>
            </goals>
            <configuration>
              <nodeVersion>${node.version}</nodeVersion>
              <npmVersion>${npm.version}</npmVersion>
            </configuration>
          </execution>
          <execution>
            <id>npm install</id>
            <goals>
              <goal>npm</goal>
            </goals>
            <configuration>
              <arguments>install</arguments>
            </configuration>
          </execution>
          <execution>
            <id>npm build</id>
            <goals>
              <goal>npm</goal>
            </goals>
            <configuration>
              <!-- deployment context path -->
              <arguments>run build -- --base-href "/reportviewer/"</arguments>
            </configuration>
          </execution>
          <execution>
            <id>npm lint</id>
            <goals>
              <goal>npm</goal>
            </goals>
            <phase>test</phase>
            <configuration>
              <arguments>run lint</arguments>
            </configuration>
          </execution>
          <!-- https://jira.mitre.org/browse/FACSAFEPOR-533
          <execution>
            <id>npm test</id>
            <goals>
              <goal>npm</goal>
            </goals>
            <phase>test</phase>
            <configuration>
              <arguments>run test:ci</arguments>
            </configuration>
          </execution>
          -->
        </executions>
      </plugin>

2) run mvn install

PS C:\Users\ltheisen\git\facility-report-viewer-ui> mvn clean install
[INFO] Scanning for projects...
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Building Report Viewer UI 1.0-SNAPSHOT
[INFO] ------------------------------------------------------------------------
[INFO]
[INFO] --- maven-clean-plugin:3.0.0:clean (default-clean) @ report-viewer-ui ---
[INFO] Deleting C:\Users\ltheisen\git\facility-report-viewer-ui\target
[INFO] Deleting C:\Users\ltheisen\git\facility-report-viewer-ui\node (includes = [], excludes = [])
[INFO] Deleting C:\Users\ltheisen\git\facility-report-viewer-ui\node_modules (includes = [], excludes = [])
[INFO]
[INFO] --- frontend-maven-plugin:1.6:install-node-and-npm (install node and npm) @ report-viewer-ui ---
[INFO] Found proxies: [https{protocol='https', host='gatekeeper-w.mitre.org', port=80}, http{protocol='http', host='gatekeeper-w.mitre.org', port=80}]
[INFO] Installing node version v9.3.0
[INFO] Unpacking C:\Users\ltheisen\.m2\repository\com\github\eirslett\node\9.3.0\node-9.3.0-win-x64.zip into C:\Users\ltheisen\git\facility-report-viewer-ui\node\tmp
[INFO] Copying node binary from C:\Users\ltheisen\git\facility-report-viewer-ui\node\tmp\node-v9.3.0-win-x64\node.exe to C:\Users\ltheisen\git\facility-report-viewer-ui\node\node.exe
[INFO] Installed node locally.
[INFO]
[INFO] --- frontend-maven-plugin:1.6:npm (npm install) @ report-viewer-ui ---
[INFO] Found proxies: [https{protocol='https', host='gatekeeper-w.mitre.org', port=80}, http{protocol='http', host='gatekeeper-w.mitre.org', port=80}]
[INFO] Running 'npm install --https-proxy=http://gatekeeper-w.mitre.org:80 --proxy=http://gatekeeper-w.mitre.org:80' in C:\Users\ltheisen\git\facility-report-viewer-ui
[INFO]
[INFO] > node-sass@4.7.2 install C:\Users\ltheisen\git\facility-report-viewer-ui\node_modules\node-sass
[INFO] > node scripts/install.js
[INFO]
[INFO] Cached binary found at C:\Users\ltheisen\AppData\Roaming\npm-cache\node-sass\4.7.2\win32-x64-59_binding.node
[INFO]
[INFO] > puppeteer@1.0.0-next.1515786200433 install C:\Users\ltheisen\git\facility-report-viewer-ui\node_modules\puppeteer
[INFO] > node install.js
[INFO]
[ERROR]
[INFO] Chromium downloaded to C:\Users\ltheisen\git\facility-report-viewer-ui\node_modules\puppeteer\.local-chromium\win64-526987
[INFO]
[INFO] > uglifyjs-webpack-plugin@0.4.6 postinstall C:\Users\ltheisen\git\facility-report-viewer-ui\node_modules\webpack\node_modules\uglifyjs-webpack-plugin
[INFO] > node lib/post_install.js
[INFO]
[INFO]
[INFO] > node-sass@4.7.2 postinstall C:\Users\ltheisen\git\facility-report-viewer-ui\node_modules\node-sass
[INFO] > node scripts/build.js
[INFO]
[INFO] Binary found at C:\Users\ltheisen\git\facility-report-viewer-ui\node_modules\node-sass\vendor\win32-x64-59\binding.node
[INFO] Testing binary
[INFO] Binary is fine
[INFO] added 1061 packages in 104.251s
[INFO]
[INFO] --- frontend-maven-plugin:1.6:npm (npm build) @ report-viewer-ui ---
[INFO] Found proxies: [https{protocol='https', host='gatekeeper-w.mitre.org', port=80}, http{protocol='http', host='gatekeeper-w.mitre.org', port=80}]
[INFO] Running 'npm run build -- --base-href "/reportviewer/" --https-proxy=http://gatekeeper-w.mitre.org:80 --proxy=http://gatekeeper-w.mitre.org:80' in C:\Users\ltheisen\git\facility-report-viewer-ui
[INFO]
[INFO] > report-viewer-ui@0.0.0 build C:\Users\ltheisen\git\facility-report-viewer-ui
[INFO] > ng build "--base-href" "/reportviewer/" "--https-proxy=http://gatekeeper-w.mitre.org:80" "--proxy=http://gatekeeper-w.mitre.org:80"
[INFO]
[INFO] The option '--https-proxy' is not registered with the build command. Run `ng build --help` for a list of supported options.
[INFO] The option '--proxy' is not registered with the build command. Run `ng build --help` for a list of supported options.
[INFO] Date: 2018-05-06T21:04:27.830Z
[INFO] Hash: 5ed36070214c73c59acd
[INFO] Time: 13331ms
[INFO] chunk {inline} inline.bundle.js, inline.bundle.js.map (inline) 5.83 kB [entry] [rendered]
[INFO] chunk {main} main.bundle.js, main.bundle.js.map (main) 104 kB [initial] [rendered]
[INFO] chunk {polyfills} polyfills.bundle.js, polyfills.bundle.js.map (polyfills) 342 kB [initial] [rendered]
[INFO] chunk {styles} styles.bundle.js, styles.bundle.js.map (styles) 174 kB [initial] [rendered]
[INFO] chunk {vendor} vendor.bundle.js, vendor.bundle.js.map (vendor) 4.8 MB [initial] [rendered]
[INFO]
[INFO] --- maven-resources-plugin:2.6:resources (default-resources) @ report-viewer-ui ---
[WARNING] Using platform encoding (Cp1252 actually) to copy filtered resources, i.e. build is platform dependent!
[INFO] skip non existing resourceDirectory C:\Users\ltheisen\git\facility-report-viewer-ui\src\main\resources
[INFO]
[INFO] --- maven-compiler-plugin:3.1:compile (default-compile) @ report-viewer-ui ---
[INFO] No sources to compile
[INFO]
[INFO] --- maven-resources-plugin:2.6:testResources (default-testResources) @ report-viewer-ui ---
[WARNING] Using platform encoding (Cp1252 actually) to copy filtered resources, i.e. build is platform dependent!
[INFO] skip non existing resourceDirectory C:\Users\ltheisen\git\facility-report-viewer-ui\src\test\resources
[INFO]
[INFO] --- maven-compiler-plugin:3.1:testCompile (default-testCompile) @ report-viewer-ui ---
[INFO] No sources to compile
[INFO]
[INFO] --- maven-surefire-plugin:2.12.4:test (default-test) @ report-viewer-ui ---
[INFO] No tests to run.
[INFO]
[INFO] --- frontend-maven-plugin:1.6:npm (npm lint) @ report-viewer-ui ---
[INFO] Found proxies: [https{protocol='https', host='gatekeeper-w.mitre.org', port=80}, http{protocol='http', host='gatekeeper-w.mitre.org', port=80}]
[INFO] Running 'npm run lint --https-proxy=http://gatekeeper-w.mitre.org:80 --proxy=http://gatekeeper-w.mitre.org:80' in C:\Users\ltheisen\git\facility-report-viewer-ui
[INFO]
[INFO] > report-viewer-ui@0.0.0 lint C:\Users\ltheisen\git\facility-report-viewer-ui
[INFO] > ng lint
[INFO]
[INFO]
[INFO]
[INFO] All files pass linting.
[INFO]
[INFO] --- maven-jar-plugin:2.4:jar (default-jar) @ report-viewer-ui ---
[INFO] Building jar: C:\Users\ltheisen\git\facility-report-viewer-ui\target\report-viewer-ui-1.0-SNAPSHOT.jar
[INFO]
[INFO] --- maven-install-plugin:2.4:install (default-install) @ report-viewer-ui ---
[INFO] Installing C:\Users\ltheisen\git\facility-report-viewer-ui\target\report-viewer-ui-1.0-SNAPSHOT.jar to C:\Users\ltheisen\.m2\repository\org\mitre\facilitysafety\report-viewer-ui\1.0-SNAPSHOT\report-viewer-ui-1.0-SNAPSHOT.jar
[INFO] Installing C:\Users\ltheisen\git\facility-report-viewer-ui\pom.xml to C:\Users\ltheisen\.m2\repository\org\mitre\facilitysafety\report-viewer-ui\1.0-SNAPSHOT\report-viewer-ui-1.0-SNAPSHOT.pom
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 04:42 min
[INFO] Finished at: 2018-05-06T17:04:41-04:00
[INFO] Final Memory: 13M/256M
[INFO] ------------------------------------------------------------------------

3) find node zombies:

PS C:\Users\ltheisen\git\facility-report-viewer-ui> Get-Process -Name node

Handles  NPM(K)    PM(K)      WS(K)     CPU(s)     Id  SI ProcessName
-------  ------    -----      -----     ------     --  -- -----------
    185      15    18612      31700       0.58   4600   1 node
    186      14    18676      31740       0.63  10132   1 node
    186      14    18484      31644       0.59  13080   1 node

What is the expected behavior? all node processes are terminated after completion

Please mention your frontend-maven-plugin and operating system version. frontend-maven-plugin version: 1.6 os version: Windows 10 Version 1709

naxmefy commented 6 years ago

same issue

lokanx commented 5 years ago

Also have same issue

lokanx commented 5 years ago

Any update on this issue?