Skip to content
This repository has been archived by the owner on Jul 24, 2019. It is now read-only.

Zip extraction not moved to expected location #38

Closed
TrejGun opened this issue Mar 20, 2013 · 15 comments
Closed

Zip extraction not moved to expected location #38

TrejGun opened this issue Mar 20, 2013 · 15 comments

Comments

@TrejGun
Copy link

TrejGun commented Mar 20, 2013

shouldn't it be same dir name in this 3 lines ?

https://github.com/Obvious/phantomjs/blob/master/install.js#L21
https://github.com/Obvious/phantomjs/blob/master/lib/phantomjs.js#L2
https://github.com/Obvious/phantomjs/blob/master/bin/phantomjs#L6

@mattgoldspink
Copy link

We've just hit this issue on CI builds which do a fresh NPM install since last night. The task no longer picks up the correct path to the phantomjs binary. Rolling back to 1.8.2-0 works fine. I can see the install is different:

1.8.2-0
image

1.8.2-1
image

It seems that a runtime the path is never resolve to phantomjs/bin and always phantomjs/lib/bin hence it fails. This is causing problems for anything which doesn't depend on exact versions of phantomjs, so anyone using grunt-lib-phantomjs is hit because that uses:

"phantomjs": "~1.8.1"

Which from the NPM repo means anyone using the following and doing an npm install will be hit:

grunt-barista, grunt-contrib-jasmine, grunt-contrib-qunit, grunt-mocha, grunt-mocha-phantom-hack, grunt-qunit-serverless, grunt-sencha-dependencies

@dpup
Copy link
Contributor

dpup commented Mar 20, 2013

Looking into this now.

On Wed, Mar 20, 2013 at 7:24 AM, Matt Goldspink notifications@github.comwrote:

We've just hit this issue on CI builds which do a fresh NPM install since
last night. The task no longer picks up the correct path to the phantomjs
binary. Rolling back to 1.8.2-0 works fine. I can see the install is
different:

1.8.2-0
[image: image]https://f.cloud.github.com/assets/415690/280902/2b3ff57a-9169-11e2-912a-559a34dc5ab7.png

1.8.2-1
[image: image]https://f.cloud.github.com/assets/415690/280925/c2822246-9169-11e2-82fb-99841c6c429a.png

It seems that a runtime the path is never resolve to phantomjs/bin and
always phantomjs/lib/bin hence it fails. This is causing problems for
anything which doesn't depend on exact versions of phantomjs, so anyone
using grunt-lib-phantomjs is hit because that uses:

"phantomjs": "~1.8.1"

Which from the NPM repo means anyone using the following and doing an npm
install will be hit:

grunt-barista, grunt-contrib-jasmine, grunt-contrib-qunit, grunt-mocha,
grunt-mocha-phantom-hack, grunt-qunit-serverless, grunt-sencha-dependencies


Reply to this email directly or view it on GitHubhttps://github.com//issues/38#issuecomment-15178433
.

@dpup
Copy link
Contributor

dpup commented Mar 20, 2013

What OS are you using and version of node?

If I do the following, it points at the right binary:

npm install phantomjs
node -e 'console.log(require("phantomjs").path)' | xargs ls

On Wed, Mar 20, 2013 at 9:07 AM, Dan Pupius dan@obvious.com wrote:

Looking into this now.

On Wed, Mar 20, 2013 at 7:24 AM, Matt Goldspink notifications@github.comwrote:

We've just hit this issue on CI builds which do a fresh NPM install since
last night. The task no longer picks up the correct path to the phantomjs
binary. Rolling back to 1.8.2-0 works fine. I can see the install is
different:

1.8.2-0
[image: image]https://f.cloud.github.com/assets/415690/280902/2b3ff57a-9169-11e2-912a-559a34dc5ab7.png

1.8.2-1
[image: image]https://f.cloud.github.com/assets/415690/280925/c2822246-9169-11e2-82fb-99841c6c429a.png

It seems that a runtime the path is never resolve to phantomjs/bin and
always phantomjs/lib/bin hence it fails. This is causing problems for
anything which doesn't depend on exact versions of phantomjs, so anyone
using grunt-lib-phantomjs is hit because that uses:

"phantomjs": "~1.8.1"

Which from the NPM repo means anyone using the following and doing an npm
install will be hit:

grunt-barista, grunt-contrib-jasmine, grunt-contrib-qunit, grunt-mocha,
grunt-mocha-phantom-hack, grunt-qunit-serverless, grunt-sencha-dependencies


Reply to this email directly or view it on GitHubhttps://github.com//issues/38#issuecomment-15178433
.

@CrisFavero
Copy link

I am also having this issue and i am using OS X

$node -e 'console.log(require("phantomjs").path)' | xargs ls
ls: /Users/cmfavero/code/projectName/node_modules/phantomjs/lib/phantom/bin/phantomjs: No such file or directory

is the output of your command you requested for me

@dpup
Copy link
Contributor

dpup commented Mar 20, 2013

What node version. Can you see if 1.8.2-2 makes any difference. I don't
expect it to, but given I can't repo it was a stab in the dark.

On Wed, Mar 20, 2013 at 9:24 AM, Cris Favero notifications@github.comwrote:

I am also having this issue and i am using OS X

$node -e 'console.log(require("phantomjs").path)' | xargs ls
ls:
/Users/cmfavero/code/projectName/node_modules/phantomjs/lib/phantom/bin/phantomjs:
No such file or directory

is the output of your command you requested for me


Reply to this email directly or view it on GitHubhttps://github.com//issues/38#issuecomment-15186355
.

@CrisFavero
Copy link

v0.8.14 and i just pulled it directly from github master when i did this test

@TrejGun
Copy link
Author

TrejGun commented Mar 20, 2013

im using OS X 10.8.2

❯ node --version                                                                                                                                              
v0.8.20
❯ phantomjs --version                                                                                                                                         
1.8.2

your code sample throw an error

❯ node -e 'console.log(require("phantomjs").path)' | xargs ls                                                                                                   ✹ ✭

module.js:340
    throw err;
          ^
Error: Cannot find module 'phantomjs'
    at Function.Module._resolveFilename (module.js:338:15)
    at Function.Module._load (module.js:280:25)
    at Module.require (module.js:362:17)
    at require (module.js:378:17)
    at [eval]:1:13
    at Object.<anonymous> ([eval]-wrapper:6:22)
    at Module._compile (module.js:449:26)
    at evalScript (node.js:282:25)
    at startup (node.js:76:7)
    at node.js:627:3

but actually its installed in
/Users/user_name/projects/project_name/node_modules/grunt-contrib-qunit/node_modules/grunt-lib-phantomjs/node_modules/phantomjs

@dpup
Copy link
Contributor

dpup commented Mar 20, 2013

@marioatlp : Ok, let me switch back to 0.8.14. It's quite possible that soem of the dependencies no longer work with older versions of node. Could I suggest moving to 0.8.22 at least, we started using it in production this week and things look ok.

@CTAPbIuMABP : You need to npm install phantomjs for that code snippet to work, not have it referenced via grunt. Node will only look in the node_modules directory in the cwd.

@CrisFavero
Copy link

yes i can try changing to 0.8.22. I will say that it did download the zip file and extract the binary into tmp directory just fine. if its suppose to move it after that, that part must not have occured

@TrejGun
Copy link
Author

TrejGun commented Mar 20, 2013

❯ node -e 'console.log(require("phantomjs").path)' | xargs ls    
/Users/user_name/projects/project_name/node_modules/phantomjs/lib/phantomjs/bin/phantomjs

@dpup
Copy link
Contributor

dpup commented Mar 20, 2013

Confirmed it doesn't work in 0.8.14, it looks like we're not getting any of the events from the zipstream. Can I suggest you either peg to an old version of the library or upgrade to 0.8.22.

@dpup
Copy link
Contributor

dpup commented Mar 20, 2013

Could be related to EvanOxfeld/node-unzip#21

@CrisFavero
Copy link

after discussing with my fellow developers here we can't switch to an older version so i will just use a slightly older version of this that doesn't have this issue. 1.8.2-0 workes fine

@mattgoldspink
Copy link

Thanks for looking into it. We've rolled back to 1.8.2-0 as well which is suitable workaround for us. I'm on:

OSX 10.8.2
Node 0.8.18
NPM 1.2.2

@dpup
Copy link
Contributor

dpup commented Apr 2, 2013

Please try latest version.

@dpup dpup closed this as completed Apr 2, 2013
tmrudick pushed a commit to tmrudick/blanket that referenced this issue Jul 17, 2014
…new developers do not have to manually install phantom to get npm test to work.

Changes Include:

* package.json

Added a dev dependency to phantoms v1.8.2-0. This version was explicitly chosen because of a bug that occurs during the install process for phantomjs where the unzipped binary does not get moved to the right location. For more information on this bug, you can see it here: Medium/phantomjs#38

* test/testconfigs.json

Changed the "phantom" command to not rely on phantomjs to be on the PATH, it will instead reference the phantomjs that gets installed into node_modules by npm.
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants