昨天从拉了个前端项目下来,用IDEA打开,例行npm install,安装到一般报错EPERM: operation not permitted

按网上的删除package-lock.json后,情况依旧

以为是管理员权限问题,于是win + x再按a调出powershell,进入项目目录,执行npm install,报zlib: unexpected end of file,于是执行npm cache clean -force ,报错

npm ERR! The operation was rejected by your operating system.
npm ERR! It's possible that the file was already in use (by a text editor or antivirus),
npm ERR! or that you lack permissions to access it.
npm ERR!
npm ERR! If you believe this might be a permissions issue, please double-check the
npm ERR! permissions of the file and its containing directories, or try running
npm ERR! the command again as root/Administrator (though this is not recommended).

那我直接打开资源管理器,删除这个文件不就好了,可是删不掉啊,Access is denied,查看文件属性-安全-高级,Unable to display current owner. 连文件所属用户都看不到啊!

后来我甚至登录Administrator账户,都删不了

后来想了想,会不会是IDEA占用的问题呢,直接把IDEA关了,再npm cache clean -force,提示npm-cache文件夹busy,命令提示行退出该目录,再执行一次,竟然好了?!

然后npm install,竟然一切正常?!跟我闹着玩呢?