-
-
Notifications
You must be signed in to change notification settings - Fork 23
Closed
Description
const cpfile = require('cp-file');
const path = require('path')
const src = path.resolve(__dirname, './index.js');
const dest = "D:\\"
cpfile(src, dest, {
}).on('progress', (process) => console.log(process)).then(done => console.log({done}))
.catch(e => console.log(e));
stack:
$ node index.js
{ NestedError: Cannot create directory D:\: EPERM: operation not permitted, mkdir 'D:'
at makeDir.catch.error (d:\code\tset\node_modules\cp-file\fs.js:82:8)
Caused By: Error: EPERM: operation not permitted, mkdir 'D:'
nested:
{ Error: EPERM: operation not permitted, mkdir 'D:' errno: -4048, code: 'EPERM', syscall: 'mkdir', path: 'D:\' },
errno: -4048,
code: 'EPERM',
syscall: 'mkdir',
path: 'D:\',
name: 'CpFileError' }
I found that it was 'make-dir' cause error
mkdir
On Windows, using fs.mkdir() on the root directory even with recursion will result in an error:
fs.mkdir('/', { recursive: true }, (err) => {
// => [Error: EPERM: operation not permitted, mkdir 'C:\']
});
@sindresorhus help plz !!!
GerritVK, kimlimjustin and altro3
Metadata
Metadata
Assignees
Labels
No labels