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

[BUG] npm install ends with EEXIST #672

Closed
pythoulon opened this issue Jan 9, 2020 · 14 comments
Closed

[BUG] npm install ends with EEXIST #672

pythoulon opened this issue Jan 9, 2020 · 14 comments
Labels
Bug thing that needs fixing

Comments

@pythoulon
Copy link

The problem

I have cloned Microsoft's VSCode Language server. I then change directory to the example I'm interested in (lsp-samples) and run npm install in that folder.

It quickly dies the the following error message:

npm ERR! code EEXIST
npm ERR! syscall mkdir
npm ERR! path G:\My Drive\Git\vscode-extension-samples\vscode-extension-samples\lsp-sample\node_modules.staging
npm ERR! errno -4075
npm ERR! EEXIST: file already exists, mkdir 'G:\My Drive\Git\vscode-extension-samples\vscode-extension-samples\lsp-sample\node_modules.staging'
npm ERR! File exists: G:\My Drive\Git\vscode-extension-samples\vscode-extension-samples\lsp-sample\node_modules.staging
npm ERR! Remove the existing file and try again, or run npm
npm ERR! with --force to overwrite files recklessly.

See attached log file.
2020-01-09T17_39_35_413Z-debug.log

What's weird

is that it complains that the .staging directory already exists, when it is the install process itself that created the folder (when I start, there is no preexisting node_modules folder).

Any idea what the problem might be ? I've tried reinstalling npm, deleting the node_modules folder and starting over, deleting the intermediate .staging folder, using the --force option, to no avail...

@aprilmintacpineda
Copy link

aprilmintacpineda commented Jan 10, 2020

I got the same error, though probably different case.

I just did npm update -g and then after that, npm will no longer work. Here's the screenshot of the whole thing.

image

To make npm work again, I have to brew reinstall node :((

@pythoulon
Copy link
Author

pythoulon commented Jan 10, 2020

Sorry, but I don't understand how this is a duplicate of #611 ... (that said, it may be the same internal mechanism that causes both failures, is this the case?)
In my case npm install -g npm works fine (first thing I did when it started failing) ; I also performed a npm install -g typescript@latest without any problem.
Note that every time I do a npm install it dies with the same EEXIST error, but the thing it complains about varies from one case to the next (even when I totally remove the node_modules folder in between tries): in general existing .staging or .bin folder.

@LitoMore
Copy link

@pythoulon My mistake. Please ignore that 😂

@pythoulon
Copy link
Author

No problem...😁

@playniuniu
Copy link

same problem here

@aprilmintacpineda
Copy link

See #611 (comment) if that helps.

@pythoulon
Copy link
Author

More on this. I realized that my development folder is on the special drive created by Google Drive File Stream (the sync engine between Windows' file system and Google Drive).
Out of curiosity, I move the dev folder out of there onto a "real" drive. And voilà, it works!

So the problem seems to be with the way npm interacts with the virtual file system created by Drive File Stream... I'm going to leave my dev folder out of it...

@darcyclarke darcyclarke added the Bug thing that needs fixing label Oct 30, 2020
@nsitu
Copy link

nsitu commented Apr 7, 2021

@pythoulon I would second your observations about Google Drive. I am experiencing the same issue but it goes away when I move the folder to a "real" local drive. I would be curious to know whether there's a deeper dive possible here. Any idea where one might go next with this problem?

@pythoulon
Copy link
Author

@nsitu No idea... Looks like a problem somewhere deep in npm (or worse in Google Drive's implementation ?)

@laptevme
Copy link

I have the same problem with the npm update.
It worked for me:

  1. Run "npm install -g npm"
  2. Immediately delete files "npm", "npm.cmd", "npx" and "npx.cmd" from the working directory.

@pf-paul
Copy link

pf-paul commented Oct 18, 2022

Just wondering why this has been closed as completed when none of the comments address the OP's issue?

I am seeing the same error: npm ERR! EEXIST: file already exists, mkdir 'G:\My Drive\...\myproject\node_modules\.staging'
Does anyone know how to resolve this?

(I did the same as the OP, deleted .staging folder manually and then ran npm install again, but this step shouldn't be necessary if there was no node_modules folder to begin with.)

@adenike005
Copy link

hi

@abhijitmaiti
Copy link

Screen Shot 2023-11-18 at 11 43 51 PM

same problem

@kervyntan
Copy link

Facing the same issue at the moment
Screenshot 2023-12-21 at 10 41 02 AM

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

No branches or pull requests

12 participants