Eclipse maven cannot find karma executable

I can run Jasmin tests in Karma using the karma command line and the maven command line, but when I try to run maven (e.g. mvn install) from STS 3.2.0.RELEASE (Eclipse Juno 4.2) I get the following error:

Failed to execute goal com.kelveden:maven-karma-plugin:1.2:start (default) on project store-webapp: There was an error executing Karma. Cannot run program "karma": error=2, No such file or directory -> [Help 1] 

It is as if in Eclipse shells maven, it does not have / usr / local / bin in the path. Is there a way to configure to use the eclipse path when calling maven?

My environment:

  • Mac OSX 10.8.4
  • STS 3.2.0.RELEASE (Eclipse Juno 4.2)
  • maven-karma-plugin 1.2
  • karma 0.8.6 (installed globally via npm install -g karma)
  • Node.js 0.10.12 (installed using the OSX package)

Jean

+4
source share
1 answer

It appears in Mac OS X 10.8 (and possibly earlier), GUI applications do not have the same path as the terminal. To add / usr / local / bin to the global path, you need to edit (and possibly create) /etc/launchd.conf to enable setenv PATH /usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin . You must edit / create this file using admin privs, so use sudo with vi or nano sudo nano /etc/launchd.conf You will need to restart your Mac before this change takes effect. This information was found on ServerFault https://serverfault.com/questions/16355/how-to-set-global-path-on-os-x/277034#277034

+1
source

Source: https://habr.com/ru/post/1490401/


All Articles