I'm trying to run an app in windows and this app has some mocha tests. I need make. I read this
Mocha requires make. Can't find a make.exe that works on Windows
and this
Node.js cannot find module - interfering with cygwin on Windows
I have the app in the Github directory (outside of cygwin directory structure ) and i installed the windows version of node.
I Tried using powershell and setting the alias as suggested but i always get
> module.js:340 > throw err; > ^ Error: Cannot find module 'C:\cygdrive\c\Users\Nicola\AppData\Roaming\npm\node_modules\mocha\bin\mocha' > at Function.Module._resolveFilename (module.js:338:15) > at Function.Module._load (module.js:280:25) > at Module.runMain (module.js:487:10) > at process.startup.processNextTick.process._tickCallback (node.js:244:9) Makefile:5: recipe for target `test' failed make: *** > [test] Error 1
and i have mocha installed in that directory ( BTW why doesn't he look for mocha in the node_modules subdir? ). The problems seems to be the C:\cygdrive\c\Users
part how do i take that off?
I also tried copying the file to my home/ directory under cygwin but i got
./node_modules/.bin/mocha: line 1: ../mocha/bin/mocha: No such file or directory
Makefile:5: recipe for target `test' failed
make: *** [test] Error 127
what should i do?
You can configure the npm test command inside the package.json file to run mocha using the syntax below.
"scripts": {
"test": "node node_modules/mocha/bin/mocha --recursive"
},
My solution was run the command node ./node_modules/mocha/bin/mocha
It happened because mocha is not variable of environment of the Windows.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With