This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.

Bug 258266 - Command execution failed. Cannot run program "npm", Failed to execute goal org.codehaus.mojo:exec-maven-plugin:1.3.2:exec
Summary: Command execution failed. Cannot run program "npm", Failed to execute goal or...
Status: RESOLVED WORKSFORME
Alias: None
Product: projects
Classification: Unclassified
Component: Maven (show other bugs)
Version: 8.1
Hardware: Macintosh (x86) Mac OS X
: P3 normal (vote)
Assignee: Tomas Stupka
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2016-03-07 04:34 UTC by nuboat
Modified: 2016-06-20 12:08 UTC (History)
1 user (show)

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments
pom.xml (3.63 KB, text/xml)
2016-03-07 04:34 UTC, nuboat
Details

Note You need to log in before you can comment on or make changes to this bug.
Description nuboat 2016-03-07 04:34:14 UTC
Created attachment 158761 [details]
pom.xml

I tried integrate "npm" to my SpringBoot Maven project by add plugin "exec-maven-plugin" to run npm command, It's run smooth on my terminal but build failure when run inside netbeans. 

Below is build log from netbeans,
cd /.... ; JAVA_HOME=/Library/Java/JavaVirtualMachines/jdk1.8.0_71.jdk/Contents/Home "/Applications/NetBeans/NetBeans 8.1.app/Contents/Resources/NetBeans/java/maven/bin/mvn" -DskipTests=true install
Scanning for projects...
                                                                        
------------------------------------------------------------------------
Building Paybox 1.0-SNAPSHOT
------------------------------------------------------------------------

--- jacoco-maven-plugin:0.7.5.201505241946:prepare-agent (default) @ paybox ---
argLine set to -javaagent:/..../.m2/repository/org/jacoco/org.jacoco.agent/0.7.5.201505241946/org.jacoco.agent-0.7.5.201505241946-runtime.jar=destfile=/..../target/jacoco.exec

--- exec-maven-plugin:1.3.2:exec (default) @ paybox ---
------------------------------------------------------------------------
BUILD FAILURE
------------------------------------------------------------------------
Total time: 3.424s
Finished at: Mon Mar 07 11:14:58 ICT 2016
Final Memory: 14M/309M
------------------------------------------------------------------------
Failed to execute goal org.codehaus.mojo:exec-maven-plugin:1.3.2:exec (default) on project paybox: Command execution failed. Cannot run program "npm" (in directory "/...."): error=2, No such file or directory -> [Help 1]

To see the full stack trace of the errors, re-run Maven with the -e switch.
Re-run Maven using the -X switch to enable full debug logging.

For more information about the errors and possible solutions, please read the following articles:
[Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoExecutionException


PS. pom.xml is in attachment.
Comment 1 Tomas Stupka 2016-06-20 12:08:48 UTC
it looks like the PATH variable isn't set to point to 'npm'

an external maven process started from NetBeans is preset with the environmental settings from the running NetBeans instance, but unfortunately, when NetBeans is run as an installed app, this settings do not always happen to be the same an on the commandline - see also http://wiki.netbeans.org/MacOSXEnvForApp

you can also try to run NB from the commandline