npm ERR! { Error: EPERM: operation not permitted, mkdir 'D:\Program Files\nodejs\node_cache\_cacache'

created at 10-07-2021 views: 11

scene

After installing node in win10, use the command node -v and npm -v to be normal, node is installed successfully, but when running npm i, an error is reported:

npm ERR! Error: EPERM: operation not permitted, mkdir 'D:\Program Files\nodejs\node_cache\_cacache'

Reason

Insufficient permissions

Solution

solution1

  1. Find the node installation directory, 
  2. right-click Properties, 
  3. click Security, 
  4. and set the users full control authority

solution2

Run cmd in administrator mode

created at:10-07-2021
edited at: 10-07-2021: