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.


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.