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 870 forks source link

java.io.IOException: Cannot run program "/opt/app-root/src/frontend/node/node" #636

Open Waschnick opened 7 years ago

Waschnick commented 7 years ago

What is the current behavior?

[ERROR] Failed to execute goal com.github.eirslett:frontend-maven-plugin:1.5:npm (npm install) on project price-alert-backoffice-frontend: Failed to run task: 'npm install' failed. java.io.IOException: Cannot run program "/opt/app-root/src/frontend/node/node" (in directory "/opt/app-root/src/frontend"): error=2, No such file or directory

with

<plugin>
    <groupId>com.github.eirslett</groupId>
    <artifactId>frontend-maven-plugin</artifactId>
    <version>1.5</version>
    <configuration>
        <nodeVersion>v8.2.1</nodeVersion>
        <npmVerson>5.3.0</npmVerson>
    </configuration>
    <executions>
        <execution>
            <id>install node and npm</id>
            <goals>
                <goal>install-node-and-npm</goal>
            </goals>
            <phase>generate-resources</phase>
        </execution>
        <execution>
            <id>npm install</id>
            <goals>
                <goal>npm</goal>
            </goals>
            <phase>generate-resources</phase>
            <configuration>
                <arguments>install</arguments>
            </configuration>
        </execution>
        <execution>
            <id>npm build</id>
            <goals>
                <goal>npm</goal>
            </goals>
            <phase>compile</phase>
            <configuration>
                <arguments>run build</arguments>
            </configuration>
        </execution>
    </executions>
</plugin>

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

What is the expected behavior? npm install works

Please mention your frontend-maven-plugin and operating system version. Alpine Linux in a Docker container with frontend-maven-plugin 1.5 (also tried 1.4)

[INFO] Installing node version v8.2.1
--
  | [INFO] Downloading https://nodejs.org/dist/v8.2.1/node-v8.2.1-linux-x64.tar.gz to /opt/app-root/src/?/.m2/repository/com/github/eirslett/node/8.2.1/node-8.2.1-linux-x64.tar.gz
  | [INFO] No proxies configured
  | [INFO] No proxy was configured, downloading directly
  | [INFO] Unpacking /opt/app-root/src/?/.m2/repository/com/github/eirslett/node/8.2.1/node-8.2.1-linux-x64.tar.gz into /opt/app-root/src/frontend/node/tmp
  | [INFO] Copying node binary from /opt/app-root/src/frontend/node/tmp/node-v8.2.1-linux-x64/bin/node to /opt/app-root/src/frontend/node/node
  | [INFO] Extracting NPM
  | [INFO] Installed node locally.
  | [INFO]
  | [INFO] --- frontend-maven-plugin:1.5:npm (npm install) @ price-alert-backoffice-frontend ---
  | [INFO] Running 'npm install' in /opt/app-root/src/frontend
  | [INFO] ------------------------------------------------------------------------
  | [INFO] Reactor Summary:
  | [INFO]
  | [INFO] backoffice-parent ................. SUCCESS [  3.249 s]
  | [INFO] backoffice-frontend .................... FAILURE [  5.257 s]
  | [INFO] backoffice-webapp ...................... SKIPPED
  | [INFO] docker ............................................. SKIPPED
  | [INFO] ------------------------------------------------------------------------
  | [INFO] BUILD FAILURE
  | [INFO] ------------------------------------------------------------------------
  | [INFO] Total time: 10.832 s
  | [INFO] Finished at: 2017-08-02T09:51:22Z
  | [INFO] Final Memory: 34M/1501M
  | [INFO] ------------------------------------------------------------------------
  | [ERROR] Failed to execute goal com.github.eirslett:frontend-maven-plugin:1.5:npm (npm install) on project price-alert-backoffice-frontend: Failed to run task: 'npm install' failed. java.io.IOException: Cannot run program "/opt/app-root/src/frontend/node/node" (in directory "/opt/app-root/src/frontend"): error=2, No such file or directory -> [Help 1]
mriehema commented 7 years ago

Alpine Linux (in Docker) is not compatible with the default linux nodejs binary. This ticket is a duplicate of #287 and #633.

TulshiDas39 commented 4 years ago

I am facing same error