EINVAL errors (events.js:160) with Node 7.1.0 on Windows 10
- Version:
7.1.0 - Platform:
Windows 10 - Subsystem:
Events
Hej there,
several users have problems with different packages running node 7.1.0 on Windows 10:
- https://github.com/mochajs/mocha/issues/2577
- https://github.com/facebook/react-native/issues/10824
- https://github.com/electron/electron/issues/7919
- https://github.com/yeoman/yo/issues/485
- https://github.com/yeoman/yo/issues/486
All of them seem to have the following in common:
- It used to work with node 7.0.0 and stopped working with 7.1.0
- A similiar error with different stacktrace:
events.js:160
throw er; // Unhandled 'error' event
Error: write EINVAL
Could you enlighten us? Is it a regression in Node.js?
Thanks, Michael
It's possible the libuv upgrade introduced a regression, I don't see anything else that is an obvious culprit. What happens when you revert commit 106d719?
For me it broke between 7.0.0 and 7.1.0 spawning webpack-dev-server in a child process. Related: #9534
What happens when you revert commit 106d719?
I canβt reproduce the errors right now (wrong OS).
But if someone else can, how could they check if this helps? Am I right with the following steps?
- Clone nodejs/node
- Checkout branch
v7.1.0-proposal - Revert commit 106d719
- Build node source for Windows
- See: https://github.com/nodejs/node/blob/master/BUILDING.md#windows
- Try to reproduce the error
We have the same problem in Windows 10 x64
I'm new to React Native, and have encountered the same problem. Just did a fresh install, and downloaded the Awesome Project (Android), following the instructions on https://facebook.github.io/react-native/docs/getting-started.html
I'm running Windows 10, x64
Error message C:\Users\Edwin\AwesomeProject>react-native run-android 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 WriteStream.stream.write (C:\Users\Edwin\AwesomeProject\node_modules\ansi\lib\newlines.js:36:21) at Object.execFileSync (child_process.js:506:20) at Object.run (C:/Users/Edwin/AwesomeProject/node_modules/react-native/local-cli/cliEntry.js:157:16)
@bnoordhuis @mischah Rolling back 106d719 solves the problem for us with webpack-dev-server. Also solves the problem with mocha https://github.com/mochajs/mocha/issues/2577
npm-windows-upgrade here, we have the same issue.
Here is our Win10 x64 build of Node.js master (7.1.1-pre) sans 106d719 to test:
- 7z of Release folder: (link deleted) (69.8MB)
- 7z of node.exe: (link deleted) (4.2MB)
P.S. See https://github.com/nodejs/node/issues/9542#issuecomment-259958895 for updated build and link
I tried your test build, and while I didn't rebuild all my binaries and thus cannot run all my services with it, it does start up webpack-dev-server without issue and appears to run.
Can someone try this patch? https://github.com/libuv/libuv/pull/889 is currently my prime suspect, seeing how all the bug reports are for Windows 10.
diff --git a/deps/uv/src/win/tty.c b/deps/uv/src/win/tty.c
index 18d68d0..88b8ef9 100644
--- a/deps/uv/src/win/tty.c
+++ b/deps/uv/src/win/tty.c
@@ -134,7 +134,7 @@ typedef enum {
UV_UNSUPPORTED
} uv_vtermstate_t;
/* Determine whether or not ANSI support is enabled. */
-static uv_vtermstate_t uv__vterm_state = UV_UNCHECKED;
+static uv_vtermstate_t uv__vterm_state = UV_UNSUPPORTED;
static void uv__determine_vterm_state(HANDLE handle);
void uv_console_init() {
cc @nodejs/platform-windows
@bnoordhuis Fixes mocha for me.
I also had issues with weird color in my console, such as black text on black background. Makes sense as your patch is referencing ANSI support.
/cc @iWuzHere
Issue also shows up while installing windows-build-tools and running the angular-cli
@joaocgreis @bzoz can you take a look?
/cc @digitalinfinity
@bnoordhuis
libuv/libuv#889 is currently my prime suspect, seeing how all the bug reports are for Windows 10.
@miniksa can you take a look at libuv/libuv#889 too?
I was also having this error and reverted to node's stable version 6.9.* and it worked.
@bnoordhuis https://github.com/nodejs/node/issues/9542#issuecomment-259813312 patch applied to v7.1.0 source fixes the problem with webpack-dev-server and mocha for 64-bit build on Windows 10.
Here is the patched node.exe 64-bit Windows executable, built with vcbuild release nosign x64 for others to verify:
https://mega.nz/#!eRMxwCaY!Jo0aulbo-Nm0OLMAcx1pfnVdWnCXiTocBju1aA66elI
Seems like my change broke stuff π’ Created https://github.com/libuv/libuv/issues/1135
BTW, since it involves tty and ANSI codes, is this likely the cause of my issues with black-on-black colors in the console for part of the output and after the process died?
(PS: "color 07" in windows resets colors it if you struggle with this)