繁体   English   中英

fs-extra:错误:EPERM:不允许操作,取消链接

[英]fs-extra: Error: EPERM: operation not permitted, unlink

我使用fs-extra收到以下错误:

错误{[错误:EPERM:不允许操作,取消链接'C:\\ Projects \\ xxx \\ branches \\ xxx \\ release']错误号:-4048,代码:“ EPERM”,系统调用:“取消链接”,路径:“ C:\\项目\\ xxx \\分支\\ xxx \\发布'}

在我的节点应用程序中使用此代码时:

const fse = require('fs-extra');
fse.copySync('../util/various/a.html', '../release');
fse.copySync('../util/various/b.html', '../release');

我想知道什么会导致该错误以及如何解决该错误。

fs-extra不支持将文件复制到目录。

这将起作用:

const fse = require('fs-extra');
fse.copySync('../util/various/a.html', '../release/a.html');
fse.copySync('../util/various/b.html', '../release/b.html');

这是设计好的( https://github.com/jprichardson/node-fs-extra/issues/320 ),尽管我在这里是因为遇到同样的问题。

由于文件的权限,该模块无法删除目标文件(只读)。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM