简体   繁体   English

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

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

I am receiving the following error using fs-extra : 我使用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' } 错误{[错误:EPERM:不允许操作,取消链接'C:\\ Projects \\ xxx \\ branches \\ xxx \\ release']错误号:-4048,代码:“ EPERM”,系统调用:“取消链接”,路径:“ C:\\项目\\ xxx \\分支\\ xxx \\发布'}

When using this code in my node application: 在我的节点应用程序中使用此代码时:

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

I would like to know, what could cause the error and how to fix it. 我想知道什么会导致该错误以及如何解决该错误。

fs-extra doesn't support copying a file to a directory. fs-extra不支持将文件复制到目录。

This will work: 这将起作用:

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

This is as-designed ( https://github.com/jprichardson/node-fs-extra/issues/320 ) although I am here because I ran into the same issue. 这是设计好的( https://github.com/jprichardson/node-fs-extra/issues/320 ),尽管我在这里是因为遇到同样的问题。

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

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

相关问题 npm 错误! 错误:EPERM:不允许操作,取消链接 - npm ERR! Error: EPERM: operation not permitted, unlink 错误:EPERM:不允许操作,scandir - Error: EPERM: operation not permitted, scandir 错误:EPERM:不允许操作,重命名 - Error: EPERM: operation not permitted, rename 错误:EPERM:不允许操作,统计 - Error: EPERM: operation not permitted, stat require('fs-extra') 未加载:抛出错误“无法找到模块 fs-extra” - require('fs-extra') not loading: throwing error "Cant find module fs-extra" 未捕获的错误:EPERM:不允许操作,写入 - Uncaught Error: EPERM: operation not permitted, write fs-extra 抛出错误:EBUSY:资源繁忙或锁定 - fs-extra throwing ERROR: EBUSY: resource busy or locked 错误发生意外错误:“EPERM:不允许操作,取消链接'path_to_project\\\\node_modules\\\\prisma\\\\query_engine-windows.dll.node' - error An unexpected error occurred: "EPERM: operation not permitted, unlink 'path_to_project\\node_modules\\prisma\\query_engine-windows.dll.node' Bower - EPERM,解除链接错误 - Bower - EPERM, unlink error 反应本机应用程序; 启动打包程序时出错:错误:EPERM:不允许操作 - React Native application; Error starting packager: Error: EPERM: operation not permitted
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM