I'm running 'npm install' from maven using exec-maven-plugin. And it fails with such error:
module.js:340
throw err;
^
Error: Cannot find module 'D:\projects\git\code\node_modules\npm\bin\npm-cli.js'
at Function.Module._resolveFilename (module.js:338:15)
at Function.Module._load (module.js:280:25)
at Function.Module.runMain (module.js:497:10)
at startup (node.js:119:16)
at node.js:901:3
obviously there is no npm-cli under project path, it's in the global path where nodejs is installed.
So the whole build is failed with status
[ERROR] Failed to execute goal org.codehaus.mojo:exec-maven-plugin:1.2.1:exec (npm) on project myproject: Command execution failed. Process exited with an error: 8 (Exit value: 8) -> [Help 1]
Another interesting thing that 'npm install' under console is run perfectly fine. Problem only occurs when I run it from maven.
Any thoughts would be appreciated!