Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error: Target directory is expected to be absolute #124

Open
doremifaJ opened this issue Aug 6, 2021 · 4 comments
Open

Error: Target directory is expected to be absolute #124

doremifaJ opened this issue Aug 6, 2021 · 4 comments

Comments

@doremifaJ
Copy link

Why not support relative path?

@eramudeep
Copy link

eramudeep commented Aug 21, 2021

Why not support relative path?

getting the same error

try { await extract(file, { dir: "app/my-downloads/es" <====== my folder name where i want the files to extracted }) console.log('Extraction complete') } catch (err) { console.log("Error",err); // handle any errors }

@coddojrponce
Copy link

find this code => if (!path.isAbsolute(opts.dir) in extract-zip/index.html and comment it out to use relative path :)

@ayushmanchhabra
Copy link

As a workaround I convert the target directory path to absolute path using Node's path.resolve.

@Viridian-Inc
Copy link

Viridian-Inc commented Feb 13, 2024

NPM support for zip unzipping in windows

"postdownload:script:win": "powershell -Command "$path = (Resolve-Path .).Path + '\your_rel_path'; if (-Not (Test-Path $path)) { New-Item -ItemType Directory -Force -Path $path }; [System.Reflection.Assembly]::LoadWithPartialName('System.IO.Compression.FileSystem'); [System.IO.Compression.ZipFile]::ExtractToDirectory('zipped_file_name.zip', $path); Remove-Item zipped_file_name.zip"",

"postdownload:script:win": "powershell -Command \"$path = (Resolve-Path .).Path + '\\your_rel_path'; if (-Not (Test-Path $path)) { New-Item -ItemType Directory -Force -Path $path }; [System.Reflection.Assembly]::LoadWithPartialName('System.IO.Compression.FileSystem'); [System.IO.Compression.ZipFile]::ExtractToDirectory('zipped_file_name.zip', $path); Remove-Item zipped_file_name.zip\"",

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants