mochajs / mocha

☕️ simple, flexible, fun javascript test framework for node.js & the browser
https://mochajs.org
MIT License
22.57k stars 3.01k forks source link

npm test fails in Windows #807

Closed mcandre closed 11 years ago

mcandre commented 11 years ago

Trace:

$ npm test

> mocha@1.9.0 test C:\Documents and Settings\apenneba\Desktop\src\mocha
> make test-all

module.js:340
    throw err;
          ^
Error: Cannot find module 'C:\Documents'
    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
make: *** [test-bdd] Error 8
npm ERR! Test failed.  See above for more details.
npm ERR! not ok code 0

If I call the make task more directly, I get a slightly different error.

$ make test

module.js:340
    throw err;
          ^
Error: Cannot find module 'commander'
    at Function.Module._resolveFilename (module.js:338:15)
    at Function.Module._load (module.js:280:25)
    at Module.require (module.js:364:17)
    at require (module.js:380:17)
    at Object.<anonymous> (c:\Documents and Settings\apenneba\Desktop\src\mocha\bin\_mocha:7:15)
    at Module._compile (module.js:456:26)
    at Object.Module._extensions..js (module.js:474:10)
    at Module.load (module.js:356:32)
    at Function.Module._load (module.js:312:12)
    at Function.Module.runMain (module.js:497:10)
make: *** [test-unit] Error 8

System:

$ specs node os
Specs:

specs 0.4
https://github.com/mcandre/specs#readme

npm --version
1.2.17

node --version
v0.10.3

systeminfo | findstr /B /C:"OS Name" /C:"OS Version"
OS Name:                   Microsoft Windows XP Professional
OS Version:                5.1.2600 Service Pack 3 Build 2600
tj commented 11 years ago

just sounds like you haven't run npm install in the mocha dir, I don't use npm test

mcandre commented 11 years ago

I have run npm install. The same error occurs.