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

时间:2016-04-15 11:38:56

标签: javascript node.js

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

  

错误{[错误:EPERM:不允许操作,取消链接   ' C:\ Projects \ xxx \ branches \ xxx \ release']错误:-4048,代码:   ' EPERM',系统调用:'取消关联',路径:   ' C:\项目\ XXX \分支\ XXX \释放' }

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

Error
The page you are looking for is currently unavailable.

TF400813: Resource not available for anonymous access. Client authentication required.

More information about this error
TF400813: Resource not available for anonymous access. Client authentication required.

我想知道,可能导致错误的原因以及解决方法。

2 个答案:

答案 0 :(得分:1)

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)虽然我在这里是因为我遇到了同样的问题。

答案 1 :(得分:-2)

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

相关问题