Skip to content

yarn install fails inside /mnt with EINVAL for lstat during step 3 #2448

Closed

Description

  • Your Windows build number: Version 10.0.16273.1000

  • What you're doing and what's happening: (Copy&paste specific commands and their output, or include screen shots)

Running yarn (install) in a directory inside /mnt/c/Users/foo/bar

$ pwd
/mnt/c/Users/duybui/code/web/old
$ yarn
yarn install v0.27.5
warning package.json: No license field
info No lockfile found.
warning [email protected]: No license field
[1/4] Resolving packages...
warning aurelia-cli > npm > request > [email protected]: Use uuid module instead
warning browser-sync > browser-sync-ui > weinre > [email protected]: express 2.x series is deprecated
warning browser-sync > browser-sync-ui > weinre > express > [email protected]: connect 1.x series is deprecated
[2/4] Fetching packages...
warning [email protected]: The platform "linux" is incompatible with this module.
info "[email protected]" is an optional dependency and failed compatibility check. Excluding it from installation.
[3/4] Linking dependencies...
warning "[email protected]" has unmet peer dependency "react@^0.14.0 || ^15.0.0".
error An unexpected error occurred: "EINVAL: invalid argument, lstat '/mnt/c/Users/duybui/code/web/old/node_modules/accord/node_modules/cliui/README.md'".
info If you think this is a bug, please open a bug report with the information provided in "/mnt/c/Users/duybui/code/web/old/yarn-error.log".
info Visit https://yarnpkg.com/en/docs/cli/install for documentation about this command.
  • What's wrong / what should be happening instead:
    Note that every time I run the command it may fail while lstat'ing a different file.

Activity

  1. khuongduybui commented on Aug 24, 2017

    @khuongduybui
    Author

    My current workaround is to create a node_modules directory outside /mnt, then ln -s it into my directory inside /mnt.

  2. umamialex commented on Aug 24, 2017

    @umamialex

    Related issue in the Yarn repo: yarnpkg/yarn#4188

  3. hikurangi commented on Sep 3, 2017

    @hikurangi

    Also getting this when adding a dependency from the command line. I can install packages successfully using npm, so am I correct in thinking that this is a Yarn issue, not a WSL one?

    I'm on 16281.rs3 fwiw.

  4. khuongduybui commented on Sep 4, 2017

    @khuongduybui
    Author

    It's a WSL issue with the recent file system later changes

  5. tjmonsi commented on Sep 4, 2017

    @tjmonsi

    It fails on the new build of windows. I reverted back to 16251.rs3 and yarn works fine again

  6. sunilmut commented on Sep 5, 2017

    @sunilmut
    Member

    Adding Sven Groot (@SvenGroot) who is taking a look at this. Also, marking it as a bug.

  7. treebeard commented on Sep 10, 2017

    @treebeard

    Also fails on 16278.rs3, npm works fine

  8. simonbuchan commented on Sep 11, 2017

    @simonbuchan

    This looks like it's the same error in React Native's packager (roughly equivalent to webpack --watch):

    ✘130 ➜ yarn start
    yarn start v1.0.1
    $ node node_modules/react-native/local-cli/cli.js start
    Scanning 723 folders for symlinks in /mnt/c/code/learning-hub/mobile-app/node_modules (80ms)
     ┌────────────────────────────────────────────────────────────────────────────┐
     │  Running packager on port 8081.                                            │
     │                                                                            │
     │  Keep this packager running while developing on any JS projects. Feel      │
     │  free to close this tab and run your own packager instance if you          │
     │  prefer.                                                                   │
     │                                                                            │
     │  https://github.com/facebook/react-native                                  │
     │                                                                            │
     └────────────────────────────────────────────────────────────────────────────┘
    Looking for JS files in
       /mnt/c/code/learning-hub/mobile-app
    
    Loading dependency graph...
    React packager ready.
    
    Loading dependency graph, done.
    Bundling `index.android.js`
      Transforming modules  100.0% (913/913), done.
     ERROR  EINVAL: invalid argument, lstat '/mnt/c/code/learning-hub/mobile-app/.git/index.lock'
    {"errno":-22,"code":"EINVAL","syscall":"lstat","path":"/mnt/c/code/learning-hub/mobile-app/.git/index.lock"}
    Error: EINVAL: invalid argument, lstat '/mnt/c/code/learning-hub/mobile-app/.git/index.lock'
        at Error (native)
    
    See http://facebook.github.io/react-native/docs/troubleshooting.html
    for common problems and solutions.
    error Command failed with exit code 11.
    

    This one is pretty intermittent though.

  9. sunilmut commented on Sep 14, 2017

    @sunilmut
    Member

    We have been trying to get to the bottom of this issue, but the bug seems very evasive. Every time we try to gather an strace or put it under the debugger, it does not repro. Seems like some kind of race condition. If someone is able to get a strace of the failing command, that might shed some light. strace -o <trace_file> -ff <failing_cmd>

  10. AndyGauge commented on Sep 14, 2017

    @AndyGauge

    I attempted to create a react app using yarn create-react-app hello-api and ran it through the strace recommended. I zipped up the output.

    https://github.com/AndyGauge/yarn-debug/blob/master/yarn-fail.zip

  11. khuongduybui commented on Sep 15, 2017

    @khuongduybui
    Author

    When I run strace -o ~/trace.log yarn install the error does NOT show up.
    When I run strace -o /dev/null yarn install the error DOES show up.

  12. AndyGauge commented on Sep 15, 2017

    @AndyGauge
  13. CrshOverride commented on Sep 15, 2017

    @CrshOverride

    I was able to reproduce locally. You can download a zip of all of the trace files at https://www.dropbox.com/s/oy78n0qvtqqyxwb/yarn_trace.zip?dl=0

  14. hikurangi commented on Sep 16, 2017

    @hikurangi

    If it helps, for me the problem seems to be resolved in 16288.1.

  15. 91 remaining items

  16. mindhaq commented on Dec 7, 2017

    @mindhaq

    Rich Turner (@bitcrazed) Apart from slow IO it is working fine now, thank you!

    It's good to hear that disk perf is being addressed. Is there an Issue to follow on?

  17. bitcrazed commented on Dec 7, 2017

    @bitcrazed
    Contributor

    Thanks for letting us know.

    The larger disk perf issue is primarily being tracked in issue #873

  18. shjyh commented on Dec 11, 2017

    @shjyh

    I upgrade my OS to newest insider preview(17025.10000),still have this problem

  19. therealkenc commented on Dec 11, 2017

    @therealkenc

    newest insider preview(17025.10000)

    this

  20. Nadav-Ruskin commented on Jul 15, 2018

    @Nadav-Ruskin

    I am using Windows version 1803, build 17134.112 and still encountering this bug (the general, parallel building bug).

  21. su-zhuzhu commented on Jul 17, 2018

    @su-zhuzhu

    Nadav (@Nadav-Ruskin) NPM 6.0 is recommended, It is no worse than yarn now

  22. mrmckeb commented on Jul 17, 2018

    @mrmckeb

    That's not really a fair answer, @muyu66. First, it's not true that npm@6 matches Yarn in terms of functionality. More importantly, WSL is not meant to be limited to a subset of tools, and you can't expect development teams to drop Yarn because none is "recommended".

  23. Nadav-Ruskin commented on Jul 17, 2018

    @Nadav-Ruskin

    Sorry if I haven't made myself clear: The error I'm experiencing is more related to #2606, that is, I can't build (my own projects) using make -j<anything larger than 1>. I've posted about it here because this thread contains the workaround and claims that the issue has been fixed.
    I'll make a new issue to avoid further confusion.

  24. tomitrescak commented on Aug 6, 2018

    @tomitrescak

    I am receiving this bug still on the Creators Edition and having the "EINVAL: invalid argument, lstat" I can provide the package.json

  25. onomatopellan commented on Aug 6, 2018

    @onomatopellan

    Tomas Trescak (@tomitrescak) what build? (Win+R -> type winver)
    Your OS build number should be 16299.98 or later to get this fix.

  26. tomitrescak commented on Aug 6, 2018

    @tomitrescak

    Ah, ok, I got 16299.64, installing update now.

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