Your browser was unable to load all of the resources. They may have been blocked by your firewall, proxy or browser configuration.
Press Ctrl+F5 or Ctrl+Shift+R to have your browser try again.

Impossible to execute an external command in a .bat #2813

lexecutable ·
Hello !

I created a step (BUILD -> Shell/Batch command). In the command part I entered :

--
karma start test/karma.conf.js --single-run
--


And I get this error when I build :

--
16:31:46,284 INFO - C:\Work\BLABLABLA>karma start test/karma.conf.js --single-run
16:31:46,287 WARN - 'karma' is not recognized as an internal or external command,
16:31:46,287 WARN - operable program or batch file.
--

I really don't know why !

-If I a put a "dir C:\Program Files\nodejs\node_modules\npm\node_modules\karma\bin" in the step, I can see that the file karma exist so the "file not found problem" is not my solution.

This path ("C:\Program Files\nodejs\node_modules\npm\node_modules\karma\bin") is in the %PATH% so all is good.

The error already happened with npm, may be QB doesn't like when I use an external command ?

Thank you !
  • replies 4
  • views 2062
  • stars 0
robinshen ADMIN ·
Most probably the OS user running QB process have a different PATH than the one you see now. To verify, identify the QB agent running this failed step, stop it, and then open a command prompt from which you can successfully run "karma", and start the agent again by running:
<agent install dir>/bin/agent.bat (or agent.sh on *NIX) console

Then run the failed step again to see if it works.
lexecutable ·
Thank you for your answer :

I've tried to change to restart the agent, but it didn't fix the issue.

Adding an echo off the PATH during the step showed it properly had the karma path. I've also tried executing karma directly with the full path in the step, still didn't work.

It seems the problem is not because the application cannot find the path, but rather a security issue of some sort?

If you have another idea <!-- s:) --><img src="{SMILIES_PATH}/icon_smile.gif" alt=":)" title="Smile" /><!-- s:) -->
lexecutable ·
We found an idea, we think that there a problem because "karma" doesn't have an extension and QB doesn't recognize the script. Do you already heard about that ?
lexecutable ·
We found the problem.

Yes, it was the path. In the Path we had the full path of the karma file but not the karma.cmd file and for QB, we need karma.cmd. Thank you for your help !