node-mv
node-mv copied to clipboard
not possible to move files in Windows (v7)
mv(path.resolve('..', 'file'), path.resolve('..', 'empty1'), function(err){console.log(err)}) Error {errno: 50, code: "EPERM", path: "C:\miukki\file"}
I'm seeing this too.
oh nooo :(
the same error in windows 7
const str = fs.createReadStream(path, 'utf8')
.pipe(replaceStream(makeRegex ,replaceFn.bind(this, replaceObj), {maxMatchLen: 5000}))
const tempPath = await tempWrite(str)
await promiseMv(tempPath, path)
function promiseMv(sourceFile, destFile) {
return new Promise((res, rej) => {
mv(sourceFile, destFile, {mkdirp: true}, function(err) {
if(err) rej(err)
res()
})
})
}
(node:6448) UnhandledPromiseRejectionWarning: Unhandled promise rejection (rejection id: 2): Error: EPERM: operation
not permitted, rename 'D:\Users\SHANGW~1\AppData\Local\Temp\e89c0fcd-88a4-40f6-85e6-982dfca3f4f2' -> 'D:\dev\github
\auto-activity\static\projects\lotteryNine-12\index.html'
Just tested the simplest scenario on Windows 7. Can't reproduce in regular usage :
mv ('file', 'dir1\\file2', (err) => { err ? console.error(err) : console.log('moved') })