Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

EINVAL: invalid argument, lstat #4188

Closed
TheLarkInn opened this issue Aug 16, 2017 · 14 comments
Closed

EINVAL: invalid argument, lstat #4188

TheLarkInn opened this issue Aug 16, 2017 · 14 comments

Comments

@TheLarkInn
Copy link

Do you want to request a feature or report a bug?

Le Bug 🐛

What is the current behavior?
Strangely can't install after trying to install temporarily and then removing babel@7 alpha. Probably related to #4106

yarn install v1.0.0-20170816.1304
info No lockfile found.
[1/6] Validating package.json...
[2/6] Resolving packages...
[3/6] Fetching packages...
info fsevents@1.1.2: The platform "linux" is incompatible with this module.
info "fsevents@1.1.2" is an optional dependency and failed compatibility check. Excluding it from installation.
[4/6] Linking dependencies...
warning "ajv-keywords@1.5.1" has incorrect peer dependency "ajv@>=4.10.0".
warning "ajv-keywords@2.1.0" has incorrect peer dependency "ajv@>=5.0.0".

error An unexpected error occurred: "EINVAL: invalid argument, lstat '/mnt/c/Users/selarkin/Code/example-webpack-loader/node_modules/acorn-globals/README.md'".
info If you think this is a bug, please open a bug report with the information provided in "/mnt/c/Users/selarkin/Code/example-webpack-loader/yarn-error.log".
info Visit https://yarnpkg.com/en/docs/cli/install for documentation about this command.


If the current behavior is a bug, please provide the steps to reproduce.
cloned https://github.com/TheLarkInn/example-webpack-loader
Ran yarn, and then the error occurred.

What is the expected behavior?
Install to work correctly

Please mention your node.js, yarn and operating system version.
WSL on Windows Insider Preview 170813-1700 (Internal Self Hosted OS Build)

Yarn Error Log

Arguments: 
  /home/selarkin/.nvm/versions/node/v7.10.1/bin/node /usr/share/yarn/bin/yarn.js

PATH: 
  /home/selarkin/bin:/home/selarkin/.local/bin:/home/selarkin/.nvm/versions/node/v7.10.1/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/mnt/c/Program Files (x86)/NVIDIA Corporation/PhysX/Common:/mnt/c/Windows/System32:/mnt/c/Windows:/mnt/c/Windows/System32/wbem:/mnt/c/Windows/System32/WindowsPowerShell/v1.0:/mnt/c/Users/selarkin/AppData/Local/Microsoft/WindowsApps:/mnt/c/Program Files/Microsoft VS Code Insiders/bin:/snap/bin

Yarn version: 
  1.0.0-20170816.1304

Node version: 
  7.10.1

Platform: 
  linux x64

npm manifest: 
  {
    "scripts": {
      "webpack-defaults": "webpack-defaults",
      "start": "npm run build -- -w",
      "appveyor:test": "npm run test",
      "build": "cross-env NODE_ENV=production babel src -d dist --ignore 'src/**/*.test.js'",
      "clean": "del-cli dist",
      "lint": "eslint --cache src test",
      "lint-staged": "lint-staged",
      "prebuild": "npm run clean",
      "prepublish": "npm run build",
      "release": "standard-version",
      "security": "nsp check",
      "test": "jest",
      "test:watch": "jest --watch",
      "test:coverage": "jest --collectCoverageFrom='src/**/*.js' --coverage",
      "travis:lint": "npm run lint && npm run security",
      "travis:test": "npm run test -- --runInBand",
      "travis:coverage": "npm run test:coverage -- --runInBand"
    },
    "devDependencies": {
      "babel-cli": "6.26.0",
      "babel-jest": "^20.0.3",
      "babel-plugin-transform-object-rest-spread": "^6.23.0",
      "babel-polyfill": "^6.23.0",
      "babel-preset-env": "^1.6.0",
      "bluebird": "^3.5.0",
      "cross-env": "^5.0.5",
      "del-cli": "^1.1.0",
      "eslint": "^4.4.1",
      "eslint-config-webpack": "^1.2.5",
      "eslint-plugin-import": "^2.7.0",
      "jest": "^20.0.4",
      "lint-staged": "^4.0.3",
      "loader-runner": "^2.3.0",
      "memory-fs": "^0.4.1",
      "nsp": "^2.7.0",
      "pre-commit": "^1.2.2",
      "standard-version": "^4.2.0",
      "webpack": "^3.5.4",
      "webpack-defaults": "^1.5.0"
    },
    "main": "dist/cjs.js",
    "files": [
      "dist"
    ],
    "engines": {
      "node": ">= 4.3 < 5.0.0 || >= 5.10"
    },
    "peerDependencies": {
      "webpack": "^2.0.0 || ^3.0.0"
    },
    "pre-commit": "lint-staged",
    "lint-staged": {
      "*.js": [
        "eslint --fix",
        "git add"
      ]
    }
  }

yarn manifest: 
  No manifest

Lockfile: 
  No lockfile

Trace: 
  Error: EINVAL: invalid argument, lstat '/mnt/c/Users/selarkin/Code/example-webpack-loader/node_modules/acorn-globals/README.md'
@arcanis
Copy link
Member

arcanis commented Aug 17, 2017

Hm strange, I can't reproduce it (on OSX tho) 🤔 Does /mnt/c/Users/selarkin/Code/example-webpack-loader/node_modules/acorn-globals/README.md exists? Is it a symlink?

@BYK
Copy link
Member

BYK commented Aug 18, 2017

I can try giving this a shot in WSL soonish if we can track it down to Windows or WSL.

@umamialex
Copy link

umamialex commented Aug 24, 2017

Just updated to the latest build of Windows 10 Pro Insider Preview 16273.rs3_release.170819-1253. Also running into this issue in WSL.

I made a new folder called yarn-install-test and did yarn init with all the default values. I then did yarn add debug which worked. I then tried to yarn add babel-core, lodash, and tap and those came up with the following errors:

suitupalex@aMartinBlade /m/c/U/a/D/m/t/yarn-install-test> yarn add babel-core
yarn add v0.27.5
[1/4] Resolving packages...
[2/4] Fetching packages...
[3/4] Linking dependencies...
error An unexpected error occurred: "EINVAL: invalid argument, lstat '/mnt/c/Users/alex/Development/martin-experiments/temp/yarn-install-test/node_modules/lodash/_getSymbolsIn.js'".
info If you think this is a bug, please open a bug report with the information provided in "/mnt/c/Users/alex/Development/martin-experiments/temp/yarn-install-test/yarn-error.log".
info Visit https://yarnpkg.com/en/docs/cli/add for documentation about this command.
suitupalex@aMartinBlade /m/c/U/a/D/m/t/yarn-install-test> yarn add lodash
yarn add v0.27.5
[1/4] Resolving packages...
[2/4] Fetching packages...
[3/4] Linking dependencies...
error An unexpected error occurred: "EINVAL: invalid argument, lstat '/mnt/c/Users/alex/Development/martin-experiments/temp/yarn-install-test/node_modules/lodash/_mapCacheClear.js'".
info If you think this is a bug, please open a bug report with the information provided in "/mnt/c/Users/alex/Development/martin-experiments/temp/yarn-install-test/yarn-error.log".
info Visit https://yarnpkg.com/en/docs/cli/add for documentation about this command.
suitupalex@aMartinBlade /m/c/U/a/D/m/t/yarn-install-test> yarn add tap
yarn add v0.27.5
[1/4] Resolving packages...
[2/4] Fetching packages...
[3/4] Linking dependencies...
error An unexpected error occurred: "EINVAL: invalid argument, lstat '/mnt/c/Users/alex/Development/martin-experiments/temp/yarn-install-test/node_modules/arr-diff/README.md'".
info If you think this is a bug, please open a bug report with the information provided in "/mnt/c/Users/alex/Development/martin-experiments/temp/yarn-install-test/yarn-error.log".
info Visit https://yarnpkg.com/en/docs/cli/add for documentation about this command.

Downloading the nightly build (1.0.0-20170823.1414) didn't help.

Running yarn cache clean didn't help either.

Looks like everything works OK if you're not inside /mnt/c.

@fpqc
Copy link

fpqc commented Aug 25, 2017

@TheLarkInn Hey, by the way, the WSL team wants to see these bug reports rather than having them worked around. If you didn't file this internally at MS or as an issue on the WSL repository, you definitely should. The WSL devs don't want permanent workarounds being added in for WSL, since it makes it harder to test if their code is working, just FYI.

I'll ping @sunilmut for you.

@BYK BYK added the os-windows label Aug 25, 2017
@sunilmut
Copy link

thanks @fpqc.

@TheLarkInn - As per @suitupalex comment, Looks like everything works OK if you're not inside /mnt/c., it appears that this is only an issue in DrvFS (example /mnt/c) and not in LxFS (ex: ~, / etc). Does this issue repro for you in in your WSL home directory?

@tjmonsi
Copy link

tjmonsi commented Sep 4, 2017

This happens to me now on build 16278.rs3_release.17082501441 I think my PC upgraded itself yesterday so now I can't use yarn install :(

@tjmonsi
Copy link

tjmonsi commented Sep 4, 2017

@sunilmut I have reverted my build back to 16251.rs3_release.170721-2122 and yarn is working fine. (I have to do a clean build of my computer though...)

@BYK
Copy link
Member

BYK commented Sep 15, 2017

Do you think we can close this since this looks more like a WSL bug instead of a Yarn bug?

@sunilmut
Copy link

I would say yes since this looks like a WSL issue.

@BYK
Copy link
Member

BYK commented Sep 15, 2017

Thanks @sunilmut!

@BYK BYK closed this as completed Sep 15, 2017
@rikkit
Copy link

rikkit commented Sep 18, 2017

@sunilmut is there a way to track this issue on WSL? My workaround at the moment is to yarn install in a different directory then copy node_modules over to my /mnt/c folder. Not a big hassle but kind of annoying

@umamialex
Copy link

@rikkit: microsoft/WSL#2448

@TheLarkInn
Copy link
Author

Hey sorry for the late followup here. I wasn't sure if it was a yarn or WSL bug but it looks to be WSL related instead. Thanks for the heads up for next time!

@bsplosion
Copy link

For anyone else running into this issue, the solution that worked for us was to move node_modules to another directory outside of any /mnt volume, then symlink to the location from the project:

cd /your/project/directory
mv node_modules /node_modules
ln -s /node_modules node_modules

Just noticed that this is the same solution as what @khuongduybui put together on microsoft/WSL#2448. While this was potentially a WSL bug per @suitupalex's linked issue, we're running yarn 1.6.0, with Windows build 16299 per the other thread, and yet this problem could still only be fixed by this workaround.

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

No branches or pull requests

9 participants