gpt4 book ai didi

javascript - fs-额外 : Error: EPERM: operation not permitted, 取消链接

转载 作者:太空宇宙 更新时间:2023-11-04 02:46:57 26 4
gpt4 key购买 nike

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

ERROR { [Error: EPERM: operation not permitted, unlink 'C:\Projects\xxx\branches\xxx\release'] errno: -4048, code: 'EPERM', syscall: 'unlink', path: 'C:\Projects\xxx\branches\xxx\release' }

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

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

关于javascript - fs-额外 : Error: EPERM: operation not permitted, 取消链接,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/36646138/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com