Skip to content

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

Closed

Description

@DeividasK

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?

Activity

  1. ScottFreeCode commented on Nov 10, 2016

    @ScottFreeCode
    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?

  2. DeividasK commented on Nov 10, 2016

    @DeividasK
    Author

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

  3. DeividasK commented on Nov 10, 2016

    @DeividasK
    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.

  4. algv commented on Nov 10, 2016

    @algv

    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!.

  5. algv commented on Nov 10, 2016

    @algv

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

  6. mischah commented on Nov 10, 2016

    @mischah

    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:

  7. DeividasK commented on Nov 10, 2016

    @DeividasK
    Author

    Reverting to LTS node version 6.9.1 solves the issue.

  8. ScottFreeCode commented on Nov 11, 2016

    @ScottFreeCode
    Contributor

    Thanks everyone for being one step ahead on this!

  9. changed the title [-]Mocha fails for an unknown reason[/-] [+]write EINVAL "Unhandled 'error' event" on Windows 10 with Node 7.1.0[/+] on Nov 16, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions