admin管理员组

文章数量:1405535

I am trying out the angularjs tutorials on a 64 bit Windows 7 system because I find this framework quite interesting from what I read on its home page. I am a newbie to node.js and not experienced in Java-Script.

When running the tests, I get the following error. Can anybody find out what the problem is or give some hints how to determine that? I have a fresh Installation of node and added testacular with

npm install -g testacular

which worked fine from what was printed on the console window.

So here is the error message:

PS C:\Users\xx\Documents\Angular\angular-phonecat> .\scripts\test.bat
INFO [testacular]: Testacular server started at http://localhost:9876/
INFO [launcher]: Starting browser Chrome
ERROR [testacular]: { [Error: spawn ENOENT] code: 'ENOENT', errno: 'ENOENT', syscall: 'spawn' }
Error: spawn ENOENT
    at errnoException (child_process.js:948:11)
    at Process.ChildProcess._handle.onexit (child_process.js:739:34)

I am trying out the angularjs tutorials on a 64 bit Windows 7 system because I find this framework quite interesting from what I read on its home page. I am a newbie to node.js and not experienced in Java-Script.

When running the tests, I get the following error. Can anybody find out what the problem is or give some hints how to determine that? I have a fresh Installation of node and added testacular with

npm install -g testacular

which worked fine from what was printed on the console window.

So here is the error message:

PS C:\Users\xx\Documents\Angular\angular-phonecat> .\scripts\test.bat
INFO [testacular]: Testacular server started at http://localhost:9876/
INFO [launcher]: Starting browser Chrome
ERROR [testacular]: { [Error: spawn ENOENT] code: 'ENOENT', errno: 'ENOENT', syscall: 'spawn' }
Error: spawn ENOENT
    at errnoException (child_process.js:948:11)
    at Process.ChildProcess._handle.onexit (child_process.js:739:34)

Share asked Apr 6, 2013 at 12:20 CSharperCSharper 5343 silver badges9 bronze badges 2
  • Well, do you have chrome installed and in your path? The error is basically telling you that child_process.spawn threw ENOENT which usually means that the executable couldn't be found – Zeta Commented Apr 6, 2013 at 12:29
  • Yep, Chrome is installed and I've added Chrome's application Folder to the PATH variable. Is there a way to find out what process node.js was trying to start? – CSharper Commented Apr 7, 2013 at 17:10
Add a ment  | 

2 Answers 2

Reset to default 9

Short answer: Set env variable CHROME_BIN to full path to chrome.exe

The error msg is confusing, as the behavior of spawn got changed in Node 0.10, we need to update it (https://github./karma-runner/karma/issues/452)

Inserting 'PhantomJS' for the test browser in the karma configuration file on Windows Vista resulted in the same error message: { [Error: spawn ENOENT] code: 'ENOENT', errno: 'ENOENT', syscall: 'spawn' }

I ad-libbed on the advice above and inserted in the system path ("Environmental Variables") under "User variables for owner" PHANTOMJS_BIN with the value consisting of the path including phantomjs.exe (C:\Program Files\phantomjs-1.9.0-windows\phantomjs.exe)

All good, jasmine angularjs tests running now and much faster than with 'Chrome' or 'Firefox' as the test browser.

本文标签: javascriptError starting a test with testacularStack Overflow