max-mapper / extract-zip

Zip extraction written in pure JavaScript. Extracts a zip into a directory.
BSD 2-Clause "Simplified" License
388 stars 126 forks source link

Error: ENOENT: no such file or directory, realpath #141

Open WanGe2000 opened 2 months ago

WanGe2000 commented 2 months ago

When i unzip this file 12381.zip like this

const extractZip = require('extract-zip')

extractZip("C:\\Users\\wjdl\\Downloads\\12381.zip",{
    dir:"C:\\Users\\wjdl\\AppData\\Roaming\\Test\\cache\\mods\\temp\\12345678901234567890123456789012345678901234"
}).then(res=>{
    console.log(res)
},err=>{
    console.log(err)
})

I got an error

[Error: ENOENT: no such file or directory, realpath 'C:\Users\wjdl\AppData\Roaming\Test\cache\mods\temp\12345678901234567890123456789012345678901234\No Crafting Requirements (Fluffy Selective Install) (GamePass)\Weapons (Forge-Upgrade-Layer, Ignore Unlock Flags)\natives\MSG\data\Define\Player\Weapon\InsectGlaive'] {
  errno: -4058,
  code: 'ENOENT',
  syscall: 'realpath',
  path: 'C:\\Users\\wjdl\\AppData\\Roaming\\Test\\cache\\mods\\temp\\12345678901234567890123456789012345678901234\\No Crafting Requirements (Fluffy Selective Install) (GamePass)\\Weapons (Forge-Upgrade-Layer, Ignore Unlock Flags)\\natives\\MSG\\data\\Define\\Player\\Weapon\\InsectGlaive'
}

But when i edit the dir path to “C:\Users\wjdl\AppData\Roaming\Test\cache\mods\temp\1234567890123456789012345678901234567890123”,The error is gone,i wonder why that is.

WanGe2000 commented 2 months ago

When i unzip this file 12381.zip like this

const extractZip = require('extract-zip')

extractZip("C:\\Users\\wjdl\\Downloads\\12381.zip",{
    dir:"C:\\Users\\wjdl\\AppData\\Roaming\\Test\\cache\\mods\\temp\\12345678901234567890123456789012345678901234"
}).then(res=>{
    console.log(res)
},err=>{
    console.log(err)
})

I got an error

[Error: ENOENT: no such file or directory, realpath 'C:\Users\wjdl\AppData\Roaming\Test\cache\mods\temp\12345678901234567890123456789012345678901234\No Crafting Requirements (Fluffy Selective Install) (GamePass)\Weapons (Forge-Upgrade-Layer, Ignore Unlock Flags)\natives\MSG\data\Define\Player\Weapon\InsectGlaive'] {
  errno: -4058,
  code: 'ENOENT',
  syscall: 'realpath',
  path: 'C:\\Users\\wjdl\\AppData\\Roaming\\Test\\cache\\mods\\temp\\12345678901234567890123456789012345678901234\\No Crafting Requirements (Fluffy Selective Install) (GamePass)\\Weapons (Forge-Upgrade-Layer, Ignore Unlock Flags)\\natives\\MSG\\data\\Define\\Player\\Weapon\\InsectGlaive'
}

But when i edit the dir path to “C:\Users\wjdl\AppData\Roaming\Test\cache\mods\temp\1234567890123456789012345678901234567890123”,The error is gone,i wonder why that is.

extract-zip version: 2.0.1 nodejs version: v14.19.0 os version: Windows 11