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

! zlib: Cannot read property 'length' of null #41

Open
rzvdaniel opened this issue Feb 26, 2019 · 4 comments
Open

! zlib: Cannot read property 'length' of null #41

rzvdaniel opened this issue Feb 26, 2019 · 4 comments

Comments

@rzvdaniel
Copy link

rzvdaniel commented Feb 26, 2019

Hi guys,

When trying to create a template project with:

degit sveltejs/template my-template-project

The following error is raised in the command line:

! zlib: Cannot read property 'length' of null

degit-error

Environment

Windows 7 Professional
Command Line with/without Administrator rights
The path where I'm trying to initialize the project is not restricted in any way.

What it can be?

Update:

I think it is something related to Windows 7 or my machine. I've tested it on a Windows 10 and it is working fine. Can you please close this issue as probably there is no one to use Windows 7 anymore :P.

Best!
Razvan

@rafaelcmrj
Copy link

+1

@jap1968
Copy link

jap1968 commented Aug 27, 2019

Same problem here with Ubuntu 18.04. It is not a Windows 7 problem, definitely!

$ npx degit sveltejs/template my-svelte-project
npx: instaló 33 en 5.374s
! zlib: Cannot read property 'length' of null
$ lsb_release -a
No LSB modules are available.
Distributor ID:	Ubuntu
Description:	Ubuntu 18.04.3 LTS
Release:	18.04
Codename:	bionic
$ uname -a
Linux HPED800 4.15.0-58-generic #64-Ubuntu SMP Tue Aug 6 11:12:41 UTC 2019 x86_64 x86_64 x86_64 GNU/Linux

Update: Problem solved after updating node
$ npx degit sveltejs/template my-svelte-project
npx: instaló 33 en 2.018s

cloned sveltejs/template#master to my-svelte-project

$ node -v
v10.16.3

Previously I had node v9.0.0

@shvargon
Copy link

shvargon commented Apr 20, 2020

Sorry my bad english.

In fact, this is a similar problem with this one sapper ! zlib: unexpected end of file. The zlib problem means a problem in the downloaded archive and has nothing to do with node npm or npx. Apparently degit with a bad connection deflates a broken archive. And in the future uses it.

I quote from Readme.md
... and download the associated tar file to ~ / .degit / some-user / some-repo / commithash.tar.gz if it doesn't already exist locally

And until someone commits, he will try to use it. Solving the problem by deleting the degit folder.

The question is can degit check archive integrity?

Or add an option to reload an archive like --force-upload?

@RaminMammadzada
Copy link

Thanks @shvargon !
Deleting ~/.degit folder also helped me out.

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