Npm ERR! Error: EACCES: permission denied, rename (WSL with VS Code open)

I have been getting npm ERR! Error: EACCES: permission denied, rename errors when doing npm install on a project using Windows Subsystem for Linux (WSL) with Visual Studio Code (VS Code) open on the project.

I am running the extension Remote - WSL.

If I close VS Code and retry the install, then I get no errors.

The following comment on an open Issue on WSL appears to describe my issue:

1 Like

had the exact same issue. simply closing VS Code did the trick.

thx!

1 Like

Hi @Leiv_Hendrickx,

Welcome to the community :wave:.

It looks like VSCode with WSL Remote is doing some locking.

Closing VS Code and running the npm install command again works with no errors.

It is more of an annoyance.

Closing Remote Connection in WSL and reconnecting to it made it work for me.

1 Like