nodejs的fs模块删除文件Error: EPERM: operation not permitted, unlink

nodejs删除文件后会出现
Error: EPERM: operation not permitted, unlink,对删除权限进行控制。

 //删除文件
 fs.unlink(filePath, function (err) {
   
   
   if (err) {
   
   
         return false;
     }
     return true;
43040 warn airbnb-prop-types@2.16.0 requires a peer of react@ ^0.14 Il ^15.0.0 ll ^16.0.0-alpha but none is installed. You must install peer dependencies yourself. 43042 warn The package @types/react-router-dom is included as both a dev and production dependency. 43043 verbose stack Error: EPERM: operation not permitted, unlink 'D:\projects\testFACEICD\node_modules\.staging\highcharts-819beecb\es5\highmaps.src.js' 43044 verbose cwd D:\projects\testFACEICD 43045 verbose Windows NT 10.0.17763 43046 verbose argv "C:\Program Files\nodejs\node.exe" "C:\Program Files\nodejs\\node_modules\\npm\\bin\npm-clijs" "install" 43047 verbose node v12.19.0 43048 verbose npm v6.14.8 43049 error code EPERM 43050 error syscall unlink 43051 error path D:(projects\testFACElCD\node modules\.staqing\hiqhcharts-819beecb\es5\hiqhmaps.src.js 43052 error errno -4048 43053 error Error: EPERM: operation not permitted, unlink 'D:\projects\testFACEICD\node modules\.staging\highcharts-819beecb\es5\highmaps.src.js 43053 error [OperationalError: EPERM: operation not permitted, unlink 'D:\projects\testFACEICD\node modules\.staging\highcharts-819beecb\es5\highmaps.src.js'] { 43053 error cause: [Error: EPERM: operation not permitted, unlink 'D:projects\testFACEICD\node_modules\.staging\highcharts-819beecb\es5\highmaps.src.js] { 43053 error errno:-4048 43053 error code: 'EPERM' 43053 error syscall: 'unlink', 43053 error path: 'D:\projects\\testFACEICD\\node modules\\.staging\\highcharts-819beecb\\es5\\highmaps.src.js' 43053 error 1 43053 error errno: -4048, 43053 error code: 'EPERM', 43053 error syscall: 'unlink', 43053 error path: 'D:\\projects\\testFACEICD\\node modules\\.staging\highcharts-819beecb\\es5\\highmaps.src.js' 43053 errorparent: 'testFACEICD' 43053 error} 43054 error The operation was rejected by your operating system. 43054 error It's possible that the file was already in use (by a text editor or antivirus), 43054 error or that you lack permissions to access it 43054 error 43054 error If you believe this might be a permissions issue, please double-check the 43054 error permissions of the file and its containing directories, or try running 43054 error the command again as root/Administrator. 43055 verbose exit [ -4048, true ] 。npm install报错如上,请分析一下失败的原因,并给出解决办法
最新发布
11-06
评论
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
红包 添加红包
表情包 插入表情
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值