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

TLDR update error #445

Open
shev85 opened this issue Oct 22, 2024 · 9 comments
Open

TLDR update error #445

shev85 opened this issue Oct 22, 2024 · 9 comments

Comments

@shev85
Copy link

shev85 commented Oct 22, 2024

tldr --update
⠧ Updating.../usr/local/lib/node_modules/tldr/node_modules/adm-zip/adm-zip.js:62
throw Utils.Errors.INVALID_FILENAME();
^

Error: ADM-ZIP: Invalid filename
at Object.INVALID_FILENAME (/usr/local/lib/node_modules/tldr/node_modules/adm-zip/util/errors.js:56:16)
at new module.exports (/usr/local/lib/node_modules/tldr/node_modules/adm-zip/adm-zip.js:62:32)
at WriteStream. (/usr/local/lib/node_modules/tldr/lib/remote.js:32:21)
at WriteStream.emit (node:events:529:35)
at finish (node:internal/streams/writable:748:10)
at finishMaybe (node:internal/streams/writable:733:9)
at afterWrite (node:internal/streams/writable:507:3)
at onwrite (node:internal/streams/writable:480:7)
at node:internal/fs/streams:465:5
at node:internal/fs/streams:421:7

Node.js v18.19.1

on ubuntu 24.04,dosen’t work,how to fix it?

@kbdharun kbdharun transferred this issue from tldr-pages/tldr Oct 22, 2024
@kbdharun
Copy link
Member

Thanks for reporting the issue, can you try running tldr --clear-cache then run tldr --update to see if it fixes the issue?

@ycyin
Copy link

ycyin commented Oct 22, 2024

@kbdharun Hi! I used nvm to switch node versions 18, 20, 22 and none of them worked. Trying to use tldr --clear-cache and then tldr --update is the same issue.

[[email protected] ~ (⎈|default]$ tldr --update
⠼ Updating.../home/ttt/.nvm/versions/node/v22.9.0/lib/node_modules/tldr/node_modules/adm-zip/adm-zip.js:62
            throw Utils.Errors.INVALID_FILENAME();
            ^

Error: ADM-ZIP: Invalid filename
    at Object.INVALID_FILENAME (/home/ttt/.nvm/versions/node/v22.9.0/lib/node_modules/tldr/node_modules/adm-zip/util/errors.js:56:16)
    at new module.exports (/home/ttt/.nvm/versions/node/v22.9.0/lib/node_modules/tldr/node_modules/adm-zip/adm-zip.js:62:32)
    at WriteStream.<anonymous> (/home/ttt/.nvm/versions/node/v22.9.0/lib/node_modules/tldr/lib/remote.js:32:21)
    at WriteStream.emit (node:events:531:35)
    at finish (node:internal/streams/writable:955:10)
    at node:internal/streams/writable:936:13
    at process.processTicksAndRejections (node:internal/process/task_queues:90:21)

Node.js v22.9.0

@agnivade
Copy link
Member

I am unable to repro this. Using Node 20.11.1.

@shev85
Copy link
Author

shev85 commented Oct 24, 2024

Thanks for reporting the issue, can you try running tldr --clear-cache then run tldr --update to see if it fixes the issue?

Try tldr --clear-cache then run tldr --update , dosen't work,either.

@kbdharun
Copy link
Member

kbdharun commented Oct 24, 2024

Hi, Can you try running npm uninstall -g tldr then remove cache with npm cache clean --force then reinstall it using npm install -g tldr to see if it fixes the issue.

@LeDavid
Copy link

LeDavid commented Oct 25, 2024

It seems that I have the same problem after a fresh install:

Updating.../usr/lib/node_modules/tldr/node_modules/adm-zip/adm-zip.js:62
throw Utils.Errors.INVALID_FILENAME();
^

Error: ADM-ZIP: Invalid filename
at Object.INVALID_FILENAME (/usr/lib/node_modules/tldr/node_modules/adm-zip/util/errors.js:56:16)
at new module.exports (/usr/lib/node_modules/tldr/node_modules/adm-zip/adm-zip.js:62:32)
at WriteStream. (/usr/lib/node_modules/tldr/lib/remote.js:32:21)
at WriteStream.emit (node:events:531:35)
at finish (node:internal/streams/writable:953:10)
at node:internal/streams/writable:934:13
at process.processTicksAndRejections (node:internal/process/task_queues:82:21)

Node.js v20.18.0

I have tried all the solutions proposed above (uninstall, clear cache, etc.) but none of them solved the problem.

@kbdharun
Copy link
Member

kbdharun commented Oct 26, 2024

It seems that I have the same problem after a fresh install:

Updating.../usr/lib/node_modules/tldr/node_modules/adm-zip/adm-zip.js:62
throw Utils.Errors.INVALID_FILENAME();
^

Error: ADM-ZIP: Invalid filename
at Object.INVALID_FILENAME (/usr/lib/node_modules/tldr/node_modules/adm-zip/util/errors.js:56:16)
at new module.exports (/usr/lib/node_modules/tldr/node_modules/adm-zip/adm-zip.js:62:32)
at WriteStream. (/usr/lib/node_modules/tldr/lib/remote.js:32:21)
at WriteStream.emit (node:events:531:35)
at finish (node:internal/streams/writable:953:10)
at node:internal/streams/writable:934:13
at process.processTicksAndRejections (node:internal/process/task_queues:82:21)

Node.js v20.18.0

I have tried all the solutions proposed above (uninstall, clear cache, etc.) but none of them solved the problem.

Hi, if possible can you clone the repository here with git clone https://github.com/tldr-pages/tldr-node-client && cd tldr-node-client then install the dependencies with npm install then try ./bin/tldr --update to see if it fixes the issue and let me know.

If the issue is due to outdated dependencies, then it will be fixed when I make a new release with the updated deps from the main branch.

@LeDavid
Copy link

LeDavid commented Oct 27, 2024

I did what you wrote and I got this error message:

Updating.../home/david/Tmp/tldr-node-client/node_modules/adm-zip/zipFile.js:123
        if (endOffset == -1) throw Utils.Errors.INVALID_FORMAT();
                             ^

Error: ADM-ZIP: Invalid or unsupported zip format. No END header found
    at Object.INVALID_FORMAT (/home/david/Tmp/tldr-node-client/node_modules/adm-zip/util/errors.js:56:16)
    at readMainHeader (/home/david/Tmp/tldr-node-client/node_modules/adm-zip/zipFile.js:123:49)
    at new module.exports (/home/david/Tmp/tldr-node-client/node_modules/adm-zip/zipFile.js:21:9)
    at new module.exports (/home/david/Tmp/tldr-node-client/node_modules/adm-zip/adm-zip.js:67:18)
    at WriteStream.<anonymous> (/home/david/Tmp/tldr-node-client/lib/remote.js:32:21)
    at WriteStream.emit (node:events:531:35)
    at finish (node:internal/streams/writable:953:10)
    at node:internal/streams/writable:934:13
    at process.processTicksAndRejections (node:internal/process/task_queues:82:21)

Node.js v20.18.0

I hope this would help you to find what happens.

@sunshinekao
Copy link

⠙ Updating.../usr/local/lib/node_modules/tldr/node_modules/adm-zip/adm-zip.js:62
            throw Utils.Errors.INVALID_FILENAME();
            ^

Error: ADM-ZIP: Invalid filename
    at Object.INVALID_FILENAME (/usr/local/lib/node_modules/tldr/node_modules/adm-zip/util/errors.js:56:16)
    at new module.exports (/usr/local/lib/node_modules/tldr/node_modules/adm-zip/adm-zip.js:62:32)
    at WriteStream.<anonymous> (/usr/local/lib/node_modules/tldr/lib/remote.js:32:21)
    at WriteStream.emit (node:events:536:35)
    at finish (node:internal/streams/writable:955:10)
    at node:internal/streams/writable:936:13
    at process.processTicksAndRejections (node:internal/process/task_queues:90:21)

Node.js v22.12.0

I seem to have encountered the same problem as well

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

6 participants