Skip to content

os.networkInterfaces error in NodeJS / Yeoman #468

Closed

Description

@StfBauer

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.

Activity

  1. sunilmut commented on Jun 2, 2016

    @sunilmut
    Member

    Stefan Bauer (@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!

  2. StfBauer commented on Jun 3, 2016

    @StfBauer
    Author

    Sunil Muthuswamy (@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

  3. sunilmut commented on Jun 3, 2016

    @sunilmut
    Member

    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.

  4. StfBauer commented on Jun 3, 2016

    @StfBauer
    Author

    Sunil Muthuswamy (@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.

  5. StfBauer commented on Jun 4, 2016

    @StfBauer
    Author
  6. cadupedroni commented on Jun 15, 2016

    @cadupedroni

    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)

  7. abhishek1214 commented on Jun 29, 2016

    @abhishek1214

    Has this been fixed?

  8. abhishek1214 commented on Jun 29, 2016

    @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)

  9. nicole-ashley commented on Jun 30, 2016

    @nicole-ashley
  10. JWo1F commented on Jul 1, 2016

    @JWo1F

    Hi! When it will be done? :)

  11. sunilmut commented on Jul 5, 2016

    @sunilmut
    Member

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

  12. afdallah commented on Jul 19, 2016

    @afdallah

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

  13. simonbuchan commented on Jul 22, 2016

    @simonbuchan

    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)
    
  14. nicole-ashley commented on Jul 22, 2016

    @nicole-ashley

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

  15. 146 remaining items

  16. feryardiant commented on Apr 6, 2017

    @feryardiant

    No updates yet, unfortunately

    image

  17. benhillis commented on Apr 6, 2017

    @benhillis
    Member
  18. feryardiant commented on Apr 6, 2017

    @feryardiant

    Okay Ben Hillis (@benhillis), I'll try it and will back to you.

    image

  19. feryardiant commented on Apr 6, 2017

    @feryardiant

    I can confirm that Creators Update is solve the issue. ifconfig and ip addr show works just fine,

    $ feryardiant at Mimin-Zenbook in ~
    [12:38:04] → ifconfig
    eth1      Link encap:Ethernet  HWaddr 0a:00:27:00:00:02
              inet addr:192.168.56.1  Bcast:192.168.56.255  Mask:255.255.255.0
              inet6 addr: fe80::3411:3e51:18ca:2394/64 Scope:Unknown
              UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
              RX packets:0 errors:0 dropped:0 overruns:0 frame:0
              TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
              collisions:0
              RX bytes:0 (0.0 B)  TX bytes:0 (0.0 B)
    
    eth2      Link encap:Ethernet  HWaddr 0a:00:27:00:00:07
              inet addr:192.168.99.1  Bcast:192.168.99.255  Mask:255.255.255.0
              inet6 addr: fe80::ac6f:9be5:bf8:2298/64 Scope:Global
              UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
              RX packets:0 errors:0 dropped:0 overruns:0 frame:0
              TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
              collisions:0
              RX bytes:0 (0.0 B)  TX bytes:0 (0.0 B)
    
    lo        Link encap:Local Loopback
              inet addr:127.0.0.1  Mask:255.0.0.0
              inet6 addr: ::1/128 Scope:Global
              UP LOOPBACK RUNNING  MTU:1500  Metric:1
              RX packets:0 errors:0 dropped:0 overruns:0 frame:0
              TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
              collisions:0
              RX bytes:0 (0.0 B)  TX bytes:0 (0.0 B)
    
    wifi0     Link encap:UNSPEC  HWaddr 10-02-B5-52-3F-CD-00-00-00-00-00-00-00-00-00-00
              inet addr:192.168.1.2  Bcast:192.168.1.255  Mask:255.255.255.0
              inet6 addr: fe80::f56d:7300:e95d:d95/64 Scope:Global
              UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
              RX packets:0 errors:0 dropped:0 overruns:0 frame:0
              TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
              collisions:0
              RX bytes:0 (0.0 B)  TX bytes:0 (0.0 B)
    
    
    $ feryardiant at Mimin-Zenbook in ~
    [12:38:08] → ip addr show
    8: eth0: <> mtu 1500 group default qlen 1
        link/ether 00:ff:ce:91:fd:d4
        inet 169.254.236.98/16 brd 169.254.255.255 scope global dynamic
           valid_lft forever preferred_lft forever
        inet6 fe80::347d:e364:27e4:ec62/64 scope global dynamic
           valid_lft forever preferred_lft forever
    2: eth1: <BROADCAST,MULTICAST,UP> mtu 1500 group default qlen 1
        link/ether 0a:00:27:00:00:02
        inet 192.168.56.1/24 brd 192.168.56.255 scope global dynamic
           valid_lft forever preferred_lft forever
        inet6 fe80::3411:3e51:18ca:2394/64 scope link dynamic
           valid_lft forever preferred_lft forever
    7: eth2: <BROADCAST,MULTICAST,UP> mtu 1500 group default qlen 1
        link/ether 0a:00:27:00:00:07
        inet 192.168.99.1/24 brd 192.168.99.255 scope global dynamic
           valid_lft forever preferred_lft forever
        inet6 fe80::ac6f:9be5:bf8:2298/64 scope global dynamic
           valid_lft forever preferred_lft forever
    1: lo: <LOOPBACK,UP> mtu 1500 group default qlen 1
        link/loopback 00:00:00:00:00:00
        inet 127.0.0.1/8 brd 127.255.255.255 scope global dynamic
           valid_lft forever preferred_lft forever
        inet6 ::1/128 scope global dynamic
           valid_lft forever preferred_lft forever
    6: wifi0: <BROADCAST,MULTICAST,UP> mtu 1500 group default qlen 1
        link/ieee802.11 10:02:b5:52:3f:cd
        inet 192.168.1.2/24 brd 192.168.1.255 scope global dynamic
           valid_lft 86345sec preferred_lft 86345sec
        inet6 fe80::f56d:7300:e95d:d95/64 scope global dynamic
           valid_lft forever preferred_lft forever
    4: wifi1: <> mtu 1500 group default qlen 1
        link/ieee802.11 10:02:b5:52:3f:ce
        inet 169.254.113.41/16 brd 169.254.255.255 scope global dynamic
           valid_lft forever preferred_lft forever
        inet6 fe80::81f2:d837:a9ec:7129/64 scope global dynamic
           valid_lft forever preferred_lft forever
    

    also my npm run build is working now.

    $ feryardiant at Mimin-Zenbook in personal/codes/laravel-project on git:testing ●
    [12:41:56] → npm run build
    
    > @ build /mnt/d/Workspaces/personal/codes/laravel-project
    > node node_modules/cross-env/dist/bin/cross-env.js NODE_ENV=production node_modules/webpack/bin/webpack.js --progress --hide-modules --config=node_modules/laravel-mix/setup/webpack.config.js
    
     95% emitting
    
     DONE  Compiled successfully in 14380ms                                                                      12:42:39
                                                                                                                           Asset       Size  Chunks                    Chunk Names
      assets/js/admin.js     301 kB       0  [emitted]  [big]  assets/js/admin
        assets/js/web.js     301 kB       1  [emitted]  [big]  assets/js/web
    assets/css/admin.css   23 bytes    0, 0  [emitted]         assets/js/admin, assets/js/admin
      assets/css/web.css  519 bytes       0  [emitted]         assets/js/admin
       mix-manifest.json  194 bytes          [emitted]
    

    Considering to remove babun from my PC 🤔

    Thanks Ben Hillis (@benhillis)

  20. SFLAQiu commented on Sep 5, 2017

    @SFLAQiu

    ubuntu apt-get install npm
    run npm err
    how to solve?
    so bad


    root@2NH7VYN4YAJPLYK:~# npm

    /usr/share/npm/node_modules/npmconf/config-defs.js:322
    Object.keys(os.networkInterfaces()).map(function (nic) {
    ^
    Error: EINVAL, invalid argument
    at getLocalAddresses (/usr/share/npm/node_modules/npmconf/config-defs.js:322:18)
    at Object. (/usr/share/npm/node_modules/npmconf/config-defs.js:269:23)
    at Module._compile (module.js:456:26)
    at Object.Module._extensions..js (module.js:474:10)
    at Module.load (module.js:356:32)
    at Function.Module._load (module.js:312:12)
    at Module.require (module.js:364:17)
    at require (module.js:380:17)
    at Object. (/usr/share/npm/node_modules/npmconf/npmconf.js:4:18)
    at Module._compile (module.js:456:26)
    root@2NH7VYN4YAJPLYK:# /usr/bin/node --version
    bash: /usr/bin/node: No such file or directory
    root@2NH7VYN4YAJPLYK:
    #

  21. mikaturk commented on Sep 5, 2017

    @mikaturk

    SFLYQ (@SFLAQiu)
    You need to apt-get install node first

  22. aseering commented on Sep 5, 2017

    @aseering
    Contributor

    SFLYQ (@SFLAQiu) -- what version of Windows do you have? (Run ver at a Windows Command Prompt, and copy/paste its output here.) Is it version 14393?

    That particular error should have been fixed in Windows build 15007. You can get a newer version through Windows Update.

  23. SFLAQiu commented on Sep 6, 2017

    @SFLAQiu

    Adam Seering (@aseering) my windows os version is 14393,I'll try it out

  24. SFLAQiu commented on Sep 6, 2017

    @SFLAQiu

    Mika Turk (@mikaturk) I've installed node

  25. SFLAQiu commented on Sep 6, 2017

    @SFLAQiu

    have new question
    I remove apt-get node and npm
    then install nvm
    nvm install success and nvm install stable already


    root@2NH7VYN4YAJPLYK:/# nvm use 8
    Now using node v8.4.0 (npm v5.3.0)
    root@2NH7VYN4YAJPLYK:/# node -v
    v8.4.0
    root@2NH7VYN4YAJPLYK:/# npm -v
    5.3.0
    root@2NH7VYN4YAJPLYK:/# nvm list
    -> v8.4.0
    node -> stable (-> v8.4.0) (default)
    stable -> 8.4 (-> v8.4.0) (default)
    iojs -> N/A (default)
    root@2NH7VYN4YAJPLYK:/#


    but i restart bash,cmd node


    root@2NH7VYN4YAJPLYK:/# node
    The program 'node' can be found in the following packages:

    • node
    • nodejs-legacy
      Try: apt-get install
      root@2NH7VYN4YAJPLYK:/# node -v
      The program 'node' can be found in the following packages:
    • node
    • nodejs-legacy
      Try: apt-get install
      root@2NH7VYN4YAJPLYK:/#

    need again to nvm use
    why?

  26. MukhtarAsorori commented on Jun 3, 2018

    @MukhtarAsorori

    Is there any body can tell me how can fix this problem.
    `D:\LSTU\LearnMySelf\web\Angular2\Angular2_GettingStarted\APM>npm start

    [email protected] start D:\LSTU\LearnMySelf\web\Angular2\Angular2_GettingStarted\APM
    tsc && concurrently "tsc -w" "lite-server"

    node_modules/@angular/common/src/directives/ng_class.d.ts(48,34): error TS2304: Cannot find name 'Set'.
    node_modules/@angular/compiler/src/aot/compiler.d.ts(44,32): error TS2304: Cannot find name 'Map'.
    node_modules/@angular/compiler/src/compile_metadata.d.ts(342,20): error TS2304: Cannot find name 'Set'.
    node_modules/@angular/compiler/src/compile_metadata.d.ts(344,28): error TS2304: Cannot find name 'Set'.
    node_modules/@angular/compiler/src/compile_metadata.d.ts(346,15): error TS2304: Cannot find name 'Set'.
    node_modules/@angular/compiler/src/compile_metadata.d.ts(348,23): error TS2304: Cannot find name 'Set'.
    node_modules/@angular/compiler/src/compile_metadata.d.ts(350,17): error TS2304: Cannot find name 'Set'.
    node_modules/@angular/compiler/src/compile_metadata.d.ts(352,25): error TS2304: Cannot find name 'Set'.
    node_modules/@angular/compiler/src/output/output_ast.d.ts(433,63): error TS2304: Cannot find name 'Set'.
    node_modules/@angular/core/src/change_detection/differs/default_keyvalue_differ.d.ts(24,15): error TS2304: Cannot find name 'Map'.
    node_modules/@angular/core/src/change_detection/differs/default_keyvalue_differ.d.ts(28,16): error TS2304: Cannot find name 'Map'.
    node_modules/@angular/core/src/di/reflective_provider.d.ts(87,123): error TS2304: Cannot find name 'Map'.
    node_modules/@angular/core/src/di/reflective_provider.d.ts(87,165): error TS2304: Cannot find name 'Map'.
    node_modules/@angular/core/src/facade/lang.d.ts(12,17): error TS2304: Cannot find name 'Map'.
    node_modules/@angular/core/src/facade/lang.d.ts(13,17): error TS2304: Cannot find name 'Set'.
    node_modules/@angular/platform-browser/src/browser/browser_adapter.d.ts(79,33): error TS2304: Cannot find name 'Map'.
    node_modules/@angular/platform-browser/src/dom/dom_adapter.d.ts(97,42): error TS2304: Cannot find name 'Map'.
    node_modules/@angular/platform-browser/src/dom/dom_renderer.d.ts(22,37): error TS2304: Cannot find name 'Map'.
    node_modules/@angular/platform-browser/src/dom/shared_styles_host.d.ts(11,30): error TS2304: Cannot find name 'Set'.
    node_modules/@angular/platform-browser/src/dom/shared_styles_host.d.ts(22,30): error TS2304: Cannot find name 'Set'.
    node_modules/rxjs/Observable.d.ts(58,60): error TS2693: 'Promise' only refers to a type, but is being used as a value here.
    node_modules/rxjs/Observable.d.ts(74,59): error TS2693: 'Promise' only refers to a type, but is being used as a value here.
    npm ERR! code ELIFECYCLE
    npm ERR! errno 2
    npm ERR! [email protected] start: tsc && concurrently "tsc -w" "lite-server"
    npm ERR! Exit status 2
    npm ERR!
    npm ERR! Failed at the [email protected] start script.
    npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

    npm ERR! A complete log of this run can be found in:
    npm ERR! C:\Users\Mukhtar\AppData\Roaming\npm-cache_logs\2018-06-03T08_09_19_261Z-debug.log

    D:\LSTU\LearnMySelf\web\Angular2\Angular2_GettingStarted\APM>`

  27. dreyks commented on Jun 3, 2018

    @dreyks

    update to the latest Node version

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions