RaspberryPiFoundation / lesson_format

Lesson formatter
17 stars 28 forks source link

Phantom 1.9.2 is no longer available, cannot do a clean npm install #196

Closed phazor closed 5 months ago

phazor commented 7 years ago

Phantom 1.9.2 is no longer available. During a fresh npm install, phantomjs tries to retrieve a zip file from a location which is no longer correct *:

> phantomjs@1.9.2-6 install /Users/tristanr/dev/codeclub/lesson_format/node_modules/phantomjs
> node install.js

Downloading http://phantomjs.googlecode.com/files/phantomjs-1.9.2-macosx.zip
Saving to /var/folders/t1/nlvprp8d3dq07l96zb026zxh0000gn/T/phantomjs/phantomjs-1.9.2-macosx.zip
Receiving...
Error requesting archive
Phantom installation failed Error: Error with http request: { 'content-type': 'text/html; charset=UTF-8',
  'content-length': '1593',
  date: 'Mon, 05 Sep 2016 08:42:55 GMT',
  connection: 'close' }
    at ClientRequest.<anonymous> (/Users/tristanr/dev/codeclub/lesson_format/node_modules/phantomjs/install.js:227:23)

The fix is simple: allow patch versions, e.g. ~1.9.2, in the package.json.

This works fine for me locally (I'm building it on OSX). From this, I assume that pinning the version is no longer necessary, or there's a reason specific to another platform.

grega commented 7 years ago

Can confirm that this is indeed the case, having tried building with "phantomjs": "~1.9.2" in package.json which results in Phantom 1.9.19 being used. However, it appears that switching away from the specific Phantom version (1.9.2-6) causes an issue with rendering certain Scratch-related assets within projects (perhaps in reference to this https://github.com/CodeClub/lesson_format/issues/87#issuecomment-60216405)

Considering this is EOL, I wouldn't expect a fix here.

andylolz commented 7 years ago

I think that that node module (which has now moved here, but only installs phantomjs 2 now) just installs the phantomjs binary. You can still get 1.9.2 here: https://code.google.com/archive/p/phantomjs/downloads

I guess google code has just moved these download locations.

So I’d suggest just doing this bit manually, and removing the phantomjs node module from the dependencies list.

grega commented 7 years ago

Cheers @andylolz, that sounds like a sensible workaround.

dtt101 commented 7 years ago

We upgraded to 2.1.1 which worked: https://github.com/RaspberryPiFoundation/lesson_format/commit/7e4d1fd33df3dd83221a8dc2ae8aeeffd456880e

andylolz commented 7 years ago

Whoa. Cool! Did it break loads of other stuff??

(NB the package is now called phantomjs-prebuilt, so should probs update package.json accordingly)

dtt101 commented 7 years ago

@andylolz - just reviewing now the impact, will actually reopen this until we are certain cc @rik-cross

Thanks for chipping in!

rik-cross commented 7 years ago

Yeah... it didn't work, and I've reverted the version (https://github.com/RaspberryPiFoundation/lesson_format/commit/0f968e66cea8b5417b9e5d5383f6009107cb9f8e)

andylolz commented 7 years ago

Does that mean this is still in use?

I stopped working on this when #168 happened.

rik-cross commented 7 years ago

@andylolz No, it doesn't seem to be in use unfortunately.

dtt101 commented 7 years ago

@andylolz - yeah everything in #168 is still true, but the project is still powering a couple of things. Very much due to be retired still.