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

Summary: Command execution failed. Cannot run program "npm", Failed to execute goal org.codehaus.mojo:exec-maven-plugin:1.3.2:exec
Product: projects Reporter: nuboat
Component: MavenAssignee: Tomas Stupka <tstupka>
Status: RESOLVED WORKSFORME    
Severity: normal CC: pjiricka
Priority: P3    
Version: 8.1   
Hardware: Macintosh (x86)   
OS: Mac OS X   
Issue Type: DEFECT Exception Reporter:
Attachments: pom.xml

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