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

download.js fails to handle invalid downloads #61

Open
scrpr opened this issue Jun 20, 2024 · 2 comments
Open

download.js fails to handle invalid downloads #61

scrpr opened this issue Jun 20, 2024 · 2 comments

Comments

@scrpr
Copy link

scrpr commented Jun 20, 2024

When ripgrep downloads are corrupted or interrupted by ctrl+c, the next run fails with:

Using cached download: C:\Users\[redacted]\AppData\Local\Temp\vscode-ripgrep-cache-1.15.9\ripgrep-v13.0.0-10-x86_64-pc-windows-msvc.zip
Unzipping to [redacted]\node_modules\.pnpm\@[email protected]\node_modules\@vscode\ripgrep\bin
[redacted]\node_modules\.pnpm\@[email protected]\node_modules\@vscode\ripgrep\lib\download.js:198
                    zipFile.close();
                            ^

TypeError: Cannot read properties of undefined (reading 'close')
    at [redacted]\node_modules\.pnpm\@[email protected]\node_modules\@vscode\ripgrep\lib\download.js:198:29
    at [redacted]\node_modules\.pnpm\[email protected]\node_modules\yauzl\index.js:37:7
    at [redacted]\node_modules\.pnpm\[email protected]\node_modules\yauzl\index.js:187:5
    at [redacted]\node_modules\.pnpm\[email protected]\node_modules\yauzl\index.js:631:5
    at [redacted]\node_modules\.pnpm\[email protected]\node_modules\fd-slicer\index.js:32:7
    at FSReqCallback.wrapper [as oncomplete] (node:fs:682:5)

Node.js v20.14.0

one possible workaround is to remove zipFile.close() as there is no valid zip file to open.

@JinMokai
Copy link

JinMokai commented Jul 4, 2024

I tried to install the mdn documentation dependencies today, node version is 18.18.2, and the installation gave the same error
The package management tool used is yarn
But it doesn't affect the operation of my project

@scrpr
Copy link
Author

scrpr commented Jul 5, 2024

But it doesn't affect the operation of my project

Some projects require rg.exe to be present, if your project didn't use this, it'll be unrelated.
Currently the only way to fix this problem is to remove node module caches so that the binary could be re-downloaded again.

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

2 participants