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

[rush] VSCode node_modules folder is locked after rush package interactions #1172

Closed
benjamind opened this issue Mar 21, 2019 · 6 comments
Closed
Labels
external issue The root cause is with an external component that needs a fix or workaround

Comments

@benjamind
Copy link

This may not specifically be a Rush bug, although it is a very easy way to demonstrate the issue.

Under Windows when using VSCode with Rush to add packages or other similar operations that cause node_modules folder to be purged/relinked the following error will occur quite often:

ERROR: Error: Error: EPERM: operation not permitted, mkdir 'C:\XXXXX\node_modules'
Often this is caused by a file lock from a process such as your text editor, command prompt, or "gulp serve"

This appears to be due to TSServer within VSCode holding a reference to the node_modules folder. I believe this may be due to a directory watch that is being done to find new type definitions, but have not confirmed this yet.

Link to gitter discussion

Possible related VSCode issues:
microsoft/vscode#68576 (comment)
microsoft/TypeScript#29407

@octogonz octogonz added the external issue The root cause is with an external component that needs a fix or workaround label Mar 21, 2019
@octogonz
Copy link
Collaborator

@ScottHysom said:

I noticed this started happening on my machines with VS Code's January 2019 (1.31.1) update.

@octogonz
Copy link
Collaborator

The upstream issue microsoft/TypeScript#29407 still is not resolved.

For anyone who's hitting this, there is a workaround that avoids having to close all your VS Code windows:

Workaround: Run this command to release the lock on the file:

Screen Shot 2019-04-12 at 9 15 24 AM

@bsiegel
Copy link
Member

bsiegel commented May 2, 2019

It appears the root cause was discovered to be this electron bug: electron/node#97 and is fixed in VSCode Insiders and will be fixed in the next stable version of VSCode.

@octogonz
Copy link
Collaborator

octogonz commented May 2, 2019

This is great. Maybe we should keep this issue open until the VSCode update is released, in case others encounter the problem.

@poelstra
Copy link

It's released! And apparently, it works, too! 🎉

@octogonz
Copy link
Collaborator

Hurray!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
external issue The root cause is with an external component that needs a fix or workaround
Projects
None yet
Development

No branches or pull requests

4 participants