Win7中npm安装electron时出现权限问题 -
Posted Rudon滨海渔村
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了Win7中npm安装electron时出现权限问题 -相关的知识,希望对你有一定的参考价值。
报错
$ npm i -g electron
npm ERR! code EPERM
npm ERR! syscall mkdir
npm ERR! path C:\\Users\\mac\\AppData\\Roaming\\npm\\node_modules\\electron\\node_modules
npm ERR! errno -4048
npm ERR! Error: EPERM: operation not permitted, mkdir 'C:\\Users\\mac\\AppData\\Roaming\\npm\\node_modules\\electron\\node_modules'
npm ERR! [OperationalError: EPERM: operation not permitted, mkdir 'C:\\Users\\mac\\AppData\\Roaming\\npm\\node_modules\\electron\\node_modules']
npm ERR! cause: [Error: EPERM: operation not permitted, mkdir 'C:\\Users\\mac\\AppData\\Roaming\\npm\\node_modules\\electron\\node_modules']
npm ERR! errno: -4048,
npm ERR! code: 'EPERM',
npm ERR! syscall: 'mkdir',
npm ERR! path: 'C:\\\\Users\\\\mac\\\\AppData\\\\Roaming\\\\npm\\\\node_modules\\\\electron\\\\node_modules'
npm ERR! ,
npm ERR! errno: -4048,
npm ERR! code: 'EPERM',
npm ERR! syscall: 'mkdir',
npm ERR! path: 'C:\\\\Users\\\\mac\\\\AppData\\\\Roaming\\\\npm\\\\node_modules\\\\electron\\\\node_modules'
npm ERR!
npm ERR!
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.
npm ERR! A complete log of this run can be found in:
npm ERR! C:\\Users\\mac\\AppData\\Roaming\\npm-cache\\_logs\\2022-02-05T17_36_54_641Z-debug.log
截图
C:\\Users\\mac\\AppData\\Roaming\\npm\\node_modules\\electron 成了空文件夹,无法进入,无法删除,无法rm -Rf,无法移动命名,无法npm安装.....
解决办法
安装360,右下角搜索工具“文件粉碎机”,
添加路径,删除,即可!
以上是关于Win7中npm安装electron时出现权限问题 -的主要内容,如果未能解决你的问题,请参考以下文章