Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

write EINVAL "Unhandled 'error' event" on Windows 10 with Node 7.1.0 #2577

Closed
DeividasK opened this issue Nov 9, 2016 · 8 comments
Closed

Comments

@DeividasK
Copy link

DeividasK commented Nov 9, 2016

Hello all,

New to mocha here. I have npm install mocha --save-dev. I have a folder named test with an empty file messages.js. If I run mocha, I get the following error:

Mocha 3.1.2

events.js:160
      throw er; // Unhandled 'error' event
      ^

Error: write EINVAL
    at exports._errnoException (util.js:1022:11)
    at WriteStream.Socket._writeGeneric (net.js:715:26)
    at WriteStream.Socket._write (net.js:734:8)
    at doWrite (_stream_writable.js:334:12)
    at writeOrBuffer (_stream_writable.js:320:5)
    at WriteStream.Writable.write (_stream_writable.js:247:11)
    at WriteStream.Socket.write (net.js:661:40)
    at c:\leoboto\node_modules\mocha\bin\_mocha:483:12
    at Array.forEach (native)
    at exit (c:\leoboto\node_modules\mocha\bin\_mocha:480:11)
    at done (c:\leoboto\node_modules\mocha\lib\mocha.js:517:13)
    at Runner.<anonymous> (c:\leoboto\node_modules\mocha\lib\runner.js:826:5)
    at emitNone (events.js:91:20)
    at Runner.emit (events.js:185:7)
    at c:\leoboto\node_modules\mocha\lib\runner.js:813:12
    at Runner.runSuite (c:\leoboto\node_modules\mocha\lib\runner.js:606:12)
    at start (c:\leoboto\node_modules\mocha\lib\runner.js:811:10)
    at Runner.run (c:\leoboto\node_modules\mocha\lib\runner.js:838:5)
    at Mocha.run (c:\leoboto\node_modules\mocha\lib\mocha.js:521:17)
    at Object.<anonymous> (c:\leoboto\node_modules\mocha\bin\_mocha:458:18)
    at Module._compile (module.js:573:32)
    at Object.Module._extensions..js (module.js:582:10)
    at Module.load (module.js:490:32)
    at tryModuleLoad (module.js:449:12)
    at Function.Module._load (module.js:441:3)
    at Module.runMain (module.js:607:10)
    at run (bootstrap_node.js:420:7)
    at startup (bootstrap_node.js:139:9)
    at bootstrap_node.js:535:3
npm ERR! Test failed.  See above for more details.

Mocha 2.5.3

events.js:160
      throw er; // Unhandled 'error' event
      ^

Error: write EINVAL
    at exports._errnoException (util.js:1022:11)
    at WriteStream.Socket._writeGeneric (net.js:715:26)
    at WriteStream.Socket._write (net.js:734:8)
    at doWrite (_stream_writable.js:334:12)
    at writeOrBuffer (_stream_writable.js:320:5)
    at WriteStream.Writable.write (_stream_writable.js:247:11)
    at WriteStream.Socket.write (net.js:661:40)
    at c:\leoboto\node_modules\mocha\bin\_mocha:426:12
    at Array.forEach (native)
    at exit (c:\leoboto\node_modules\mocha\bin\_mocha:423:11)
    at done (c:\leoboto\node_modules\mocha\lib\mocha.js:498:13)
    at Runner.<anonymous> (c:\leoboto\node_modules\mocha\lib\runner.js:799:5)
    at emitNone (events.js:91:20)
    at Runner.emit (events.js:185:7)
    at c:\leoboto\node_modules\mocha\lib\runner.js:786:12
    at Runner.runSuite (c:\leoboto\node_modules\mocha\lib\runner.js:584:12)
    at start (c:\leoboto\node_modules\mocha\lib\runner.js:784:10)
    at Runner.run (c:\leoboto\node_modules\mocha\lib\runner.js:811:5)
    at Mocha.run (c:\leoboto\node_modules\mocha\lib\mocha.js:502:17)
    at Object.<anonymous> (c:\leoboto\node_modules\mocha\bin\_mocha:404:18)
    at Module._compile (module.js:573:32)
    at Object.Module._extensions..js (module.js:582:10)
    at Module.load (module.js:490:32)
    at tryModuleLoad (module.js:449:12)
    at Function.Module._load (module.js:441:3)
    at Module.runMain (module.js:607:10)
    at run (bootstrap_node.js:420:7)
    at startup (bootstrap_node.js:139:9)
    at bootstrap_node.js:535:3
npm ERR! Test failed.  See above for more details.

Windows 10
Node v7.1.0

Any ideas what could be causing this?

@ScottFreeCode
Copy link
Contributor

Hmm... So, this is an error calling process.stdout.write('', <callback>) or process.stderr.write('', <callback>). (Took me a moment to figure out the stack trace was from 2.5.3, but I found the code.) Are you piping or redirecting the output anywhere?

@DeividasK
Copy link
Author

I'm not doing anything apart from the steps mentioned above - install mocha, create empty file, run mocha.

@DeividasK
Copy link
Author

I realized, that the output in OP was from mocha 2.5.3. I have updated the OP with output from mocha 3.1.2.

@algv
Copy link

algv commented Nov 10, 2016

Have it error on Windows 10 with Node v7.1.0 (mocha 2.5.3/3.1.2)
But with node v.7.0.0 and older work nice!.

@algv
Copy link

algv commented Nov 10, 2016

This error in others projects
facebook/react-native#10824
electron/electron#7919

@mischah
Copy link

mischah commented Nov 10, 2016

I filed an issue in the Node.js repo: nodejs/node#9542

Please head over there in case you have any additional (and useful) information to share.
Thanks :octocat:

@DeividasK
Copy link
Author

Reverting to LTS node version 6.9.1 solves the issue.

@ScottFreeCode
Copy link
Contributor

Thanks everyone for being one step ahead on this!

@ScottFreeCode ScottFreeCode changed the title Mocha fails for an unknown reason write EINVAL "Unhandled 'error' event" on Windows 10 with Node 7.1.0 Nov 16, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants