Search code examples
node.jsnpmpnpm

pnpm install: ERR_PNPM_LINKING_FAILED ("operation not permitted, rename[...]")


I started on a completely fresh Windows (11) system, installed Node, pnpm and so on. When running pnpm install, I've got the following error:

"ERR_PNPM_LINKING_FAILED Error: EPERM: oprtation not permitted, rename [...]":

enter image description here

  • pnpm version: 8.7.6
  • node version: 18.18.0

It seems like from time to time this issue comes up because one can find several discussions about similar topics:

The second one looked promising but removing node_modules, pnpm prune and so on did not help in my case. I also checked the permissions for the directory, ran the commands in the admin PoweShell, did the same within the Git Bash but the error is still there.


Solution

  • It turned out that the pnpm version 8.7.6 seems to be the problem. I found two ways to solve/mitigate the problem:

    • use another pnpm version... I saw that pnpm v8.8.0 was released in the meantime and tested it. It looks like the error is gone (npm install -g [email protected] or npm install -g pnpm@latest) otherwise a downgrade would also help
    • running pnpm install again and again until it completes without erros is also a workaround. Every time you execute the command another package will throw the error until all problems are solved.