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

kit can fail to run, with zlib errors #2405

Closed
joelanman opened this issue Mar 20, 2024 · 5 comments · Fixed by #2404
Closed

kit can fail to run, with zlib errors #2405

joelanman opened this issue Mar 20, 2024 · 5 comments · Fixed by #2404
Milestone

Comments

@joelanman
Copy link
Contributor

joelanman commented Mar 20, 2024

Description of the issue

A user is reporting this error, from the use of a 13 year old version of zlib
kkaefer/DEPRECATED-node-zlib#14

I've raised a PR to fix:
#2404

As a workaround until the fix is merged you can fork or clone this starter repo instead:
https://github.com/joelanman/govuk-prototype-kit-prototype

Another workaround is to try a different version of Node

@joelanman
Copy link
Contributor Author

joelanman commented Mar 28, 2024

another user has had this issue - seems to be affecting Windows so far

Update - has been reported on Mac too

@chrishylanduk
Copy link

I ran into this too, on MacOS. https://github.com/joelanman/govuk-prototype-kit-prototype got me up and running, cheers @joelanman

@TimothyFothergill
Copy link

Just to add to this - It looks like this is affecting latest node minor versions - node version 18.20.0 it fails, however on version 18.19.0 it works - Same for 20.12.0 it fails but 20.11.0 succeeds. This issue is stopping the creation of new prototypes.

@joelanman joelanman changed the title reports that the kit fails to run, with zlib errors kit can fail to run, with zlib errors Apr 2, 2024
@36degrees
Copy link
Contributor

Looks like this is caused by a change in npm v10.4.0 – I can get the same behaviour on node v20.11.0 by bumping npm:

~/Code/zlib-test via ⬢ v20.11.0 
➜ asdf local nodejs 20.11.0

~/Code/zlib-test via ⬢ v20.11.0 
➜ npm install -g [email protected]   

removed 9 packages, and changed 46 packages in 3s

28 packages are looking for funding
  run `npm fund` for details
Reshimming asdf nodejs...

~/Code/zlib-test via ⬢ v20.11.0 took 11s 
➜ rm -rf node_modules && npm install zlib

added 1 package, and audited 2 packages in 2s

found 0 vulnerabilities

~/Code/zlib-test via ⬢ v20.11.0 took 3s 
➜ npm install -g [email protected]              

removed 11 packages, and changed 26 packages in 2s

24 packages are looking for funding
  run `npm fund` for details
Reshimming asdf nodejs...

~/Code/zlib-test via ⬢ v20.11.0 took 10s 
➜ rm -rf node_modules && npm install zlib

added 1 package, and audited 2 packages in 1s

found 0 vulnerabilities

~/Code/zlib-test via ⬢ v20.11.0 took 2s 
➜ npm install -g [email protected]              

removed 13 packages, and changed 28 packages in 2s

24 packages are looking for funding
  run `npm fund` for details
Reshimming asdf nodejs...

~/Code/zlib-test via ⬢ v20.11.0 took 10s 
➜ rm -rf node_modules && npm install zlib
npm ERR! code 127
npm ERR! path /Users/oliver.byford/Code/zlib-test/node_modules/zlib
npm ERR! command failed
npm ERR! command sh -c node-waf clean || true; node-waf configure build
npm ERR! sh: node-waf: command not found
npm ERR! sh: node-waf: command not found

npm ERR! A complete log of this run can be found in: /Users/oliver.byford/.npm/_logs/2024-04-03T11_20_23_830Z-debug-0.log

I think we're seeing this with the latest minor versions of node only because they come with the newer npm version?

I would like to understand exactly what change in 10.4.0 has caused this issue but probably not worth sinking any more time into it.

Regardless, I think removing the dependency on zlib makes sense – will review #2404.

@joelanman
Copy link
Contributor Author

yeh it's weird I can't see how it ever worked, given we are requiring that package, and it is too old and doesn't work

there is a wider bug - the npx govuk-prototype-kit create command is failing silently when this bug occurs, and it shouldn't. I wasn't sure if it was worth raising

@36degrees 36degrees added this to the v13.16.2 milestone Apr 3, 2024
@36degrees 36degrees moved this from Backlog 🏃🏼‍♀️ to Ready to release 🚀 in GOV.UK Design System cycle board Apr 3, 2024
@36degrees 36degrees moved this from Ready to release 🚀 to Done 🏁 in GOV.UK Design System cycle board Apr 5, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
4 participants