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

Yarn win32 EINVAL trying to mkdir in cache with a colon : in the dirname when add or install from github private repo URL #7824

Open
VictorBargains opened this issue Jan 19, 2020 · 2 comments

Comments

@VictorBargains
Copy link

VictorBargains commented Jan 19, 2020

This is a bug.

Error: EINVAL: invalid argument, mkdir 'C:\Users\Victor\AppData\Local\Yarn\Cache\v4\npm-growop-lib-0.0.0-ref:\node_modules\growop-lib'

Yarn version:   1.17.3

Node version:   12.10.0

Platform:   win32 x64

yarn-error.log

It appears on Windows 10. I am using within Git Bash or the VSCode TTY but I think this is a platform-specific bug so my terminal shouldn't matter.

It involves having a Project A whose package.json contains a dependency of Project B which is behind a private github URL.

I have not verified if this bug occurs when referencing public URLs to git repositories instead of private ones.

It usually works fine the first time on any computer where I do a git clone and yarn install...

And when I made a Project C that is linked the same way inside Project A, via yarn add https://github.com/foo-org/project-c.git, it usually works fine to add a second github URL dependency.

But eventually, every time I try this, I get to the point where I need to add or remove one of these packages, or upgrade them, or just add another dependency... and that's when I can't get past the EINVAL mkdir error because it's trying to turn my github ref into something with a colon : character in it in the cache, which is illegal in MSDOS and windows filenames. This occurs with both yarn install and yarn add commands.

The first few times this happened, I was able to recover through some combination of rm -rf node_modules, rm yarn.lock, yarn cache clean. Now the only way I have found to recover is to modify package.json, turn the dependency into ../project-b instead of the github URL, and then cd ..; git clone https://github.com/foo-org/project-b.git to use the dependency locally rather than through node_modules.

@Ami777
Copy link

Ami777 commented Aug 10, 2021

Any update on that?

@rudzkipl
Copy link

rudzkipl commented Sep 16, 2021

Same issue at Windows with TeamCity Agent:
image
the part with ref: breaks mkdir as it is syntax error.
We had to move from yarn to npm.

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

No branches or pull requests

3 participants