WSL icon indicating copy to clipboard operation
WSL copied to clipboard

os.networkInterfaces error in NodeJS / Yeoman

Open StfBauer opened this issue 10 years ago • 163 comments

I managed to successfully install NodeJS, NPM and Yeoman. You see all installed components in the version below.

screen shot 2016-06-03 at 00 24 33

When create a new project and type. yo <generator-name> Everything works fine. A problem happens when I just try yo. Because Yeoman somehow tries to access the network interfaces of the operation system propably. This won't work on BashOnWindows because there is no network interface directly included in the Linux Sub System and just use the same network as the host one. screen shot 2016-06-03 at 00 43 44

Am I completely wrong or can this be fixed in future releases? Thanx.

StfBauer avatar Jun 02 '16 22:06 StfBauer

@StfBauer - If you can grab a strace of the failing command 'yo', we can see where it is failing and if it is tripping on something that is currently unimplemented. Thanks for trying out WSL!

sunilmut avatar Jun 02 '16 23:06 sunilmut

@sunilmut Thank you. Attached the strace to this comment. Hope you find something useful.

Thanx for your great work so far. Love this.

yeoman-error.txt

StfBauer avatar Jun 03 '16 12:06 StfBauer

socket(PF_NETLINK, SOCK_RAW, 0) = -1 EINVAL (Invalid argument) WSL currently does not support NETLINK sockets. We are using our user voice page to prioritize the things to implement next. Please feel free to up vote this relevant task.

sunilmut avatar Jun 03 '16 18:06 sunilmut

@sunilmut Thank you for the update. This will be required for the new SharePoint Framework update released by Microsoft. Because it use Yeoman generator to extend SharePoint from Linux, MacOSX as well as Windows. In this case it would be great to use it from Bash On Windows. Will add a user voice.

StfBauer avatar Jun 03 '16 20:06 StfBauer

Added entry to user voices: https://wpdev.uservoice.com/forums/266908-command-prompt-console-bash-on-ubuntu-on-windo/suggestions/14605521-add-netlink-socket-support

StfBauer avatar Jun 04 '16 17:06 StfBauer

I had a similar problem when trying to run the ionic.

Error getting IPv4 address: Error: EINVAL: invalid argument, uv_interface_addresses (CLI v1.7.15)

cadupedroni avatar Jun 15 '16 22:06 cadupedroni

Has this been fixed?

abhishek1214 avatar Jun 29 '16 16:06 abhishek1214

Cause i am facing the same issue here is my error log

[22:09:50] Requiring external module babel-core/register /mnt/c/Users/abhis/WebProjects/emails/cts-report/node_modules/browser-sync/node_modules/dev-ip/lib/dev-ip.js:21 var networkInterfaces = require("os").networkInterfaces(); ^

Error: EINVAL: invalid argument, uv_interface_addresses at Error (native) at getIp (/mnt/c/Users/abhis/WebProjects/emails/cts-report/node_modules/browser-sync/node_modules/dev-ip/lib/dev-ip.js:21:43) at Object. (/mnt/c/Users/abhis/WebProjects/emails/cts-report/node_modules/browser-sync/lib/utils.js:4:38) at Module._compile (module.js:541:32) at Module._extensions..js (module.js:550:10) at Object.require.extensions.(anonymous function) as .js at Module.load (module.js:458:32) at tryModuleLoad (module.js:417:12) at Function.Module._load (module.js:409:3) at Module.require (module.js:468:17) Error: [email protected] start: gulp Exit status 1 at EventEmitter. (/usr/lib/node_modules/foundation-cli/node_modules/npm/lib/utils/lifecycle.js:217:16) at emitTwo (events.js:106:13) at EventEmitter.emit (events.js:191:7) at ChildProcess. (/usr/lib/node_modules/foundation-cli/node_modules/npm/lib/utils/spawn.js:24:14) at emitTwo (events.js:106:13) at ChildProcess.emit (events.js:191:7) at maybeClose (internal/child_process.js:852:16) at Process.ChildProcess._handle.onexit (internal/child_process.js:215:5)

abhishek1214 avatar Jun 29 '16 16:06 abhishek1214

@StfBauer: I don't know for sure, but could the UserVoice suggestion you created be a duplicate of https://wpdev.uservoice.com/forums/266908-command-prompt-console-bash-on-ubuntu-on-windo/suggestions/13383789-enable-network-interface-enumeraration?

nicole-ashley avatar Jun 30 '16 02:06 nicole-ashley

Hi! When it will be done? :)

JWo1F avatar Jul 01 '16 21:07 JWo1F

We are looking into supporting NETLINK and RAW sockets. It's difficult to give any ETA at the moment.

sunilmut avatar Jul 05 '16 15:07 sunilmut

I'm also facing the same problem when i run gulp. Is there any solution?

afdallah avatar Jul 19 '16 03:07 afdallah

Just a note on current build 14393 this now gets to the bind call

socket(PF_NETLINK, SOCK_RAW, 0)         = 9
bind(9, {sa_family=AF_NETLINK, pid=0, groups=00000000}, 12) = -1 EINVAL (Invalid argument)

simonbuchan avatar Jul 22 '16 05:07 simonbuchan

Woohoo, progress! Soon I'll be able to switch to WSL for my node apps

nicole-ashley avatar Jul 22 '16 05:07 nicole-ashley

Just wanna say, that BrowserSync propably fails because of the same reason:

/mnt/e/wsl/repos/static-site-generator/node_modules/dev-ip/lib/dev-ip.js:21
    var networkInterfaces = require("os").networkInterfaces();
                                          ^

Error: EINVAL: invalid argument, uv_interface_addresses
    at Error (native)
    at getIp (/mnt/e/wsl/repos/static-site-generator/node_modules/dev-ip/lib/dev-ip.js:21:43)
    at Object.<anonymous> (/mnt/e/wsl/repos/static-site-generator/node_modules/browser-sync/lib/utils.js:4:38)
    at Module._compile (module.js:541:32)
    at Module._extensions..js (module.js:550:10)
    at Object.require.extensions.(anonymous function) [as .js] (/mnt/e/wsl/repos/static-site-generator/node_modules/babel-register/lib/node.js:156:7)
    at Module.load (module.js:458:32)
    at tryModuleLoad (module.js:417:12)
    at Function.Module._load (module.js:409:3)
    at Module.require (module.js:468:17)
    at require (internal/module.js:20:19)
    at Object.<anonymous> (/mnt/e/wsl/repos/static-site-generator/node_modules/browser-sync/lib/snippet.js:9:20)
    at Module._compile (module.js:541:32)
    at Module._extensions..js (module.js:550:10)
    at Object.require.extensions.(anonymous function) [as .js] (/mnt/e/wsl/repos/static-site-generator/node_modules/babel-register/lib/node.js:156:7)
    at Module.load (module.js:458:32)

Everything is up-to-date (Windows, BrowserSync, Node, ...)

simonknittel avatar Jul 31 '16 09:07 simonknittel

@simonknittel Yes still not work for me.

Codenator81 avatar Jul 31 '16 12:07 Codenator81

Same here, i've update to the recent build. still get this error bash

afdallah avatar Aug 01 '16 13:08 afdallah

Any news on this? Any workaround? This is causing my webpack builds to fail.

mikeesouth avatar Aug 03 '16 09:08 mikeesouth

We do not need raw sockets, rather, just the ability to query what interfaces there are.. Any updates on this?

miladmostavi avatar Aug 03 '16 10:08 miladmostavi

Yep, I'm watching this as well. Breaking for me with the package "node-sass". Running "Bash on Ubuntu on Windows" in the Anniversary Update.

abergs avatar Aug 03 '16 12:08 abergs