Repository: Medium/phantomjs

Issue #11: phantomjs-0.2.0 not working on Mac
Created: 2012-10-19T02:17:33Z
The binary simply doesn't work, on ubuntu works great.
It seems the unzip module is not preserving the exec permission on zip extraction. :(
On Ubuntu works because that work is given to the tar command.

Duplicate issue #12: Downloaded bin not executable?
Created: 2012-10-25T19:21:16Z
The bin is downloaded, but it's not executable.
$ npm install --save-dev phantomjs
npm WARN package.json tmp@0.0.0 No README.md file found!
npm http GET https://registry.npmjs.org/phantomjs
npm http 304 https://registry.npmjs.org/phantomjs
npm http GET https://registry.npmjs.org/rimraf
npm http GET https://registry.npmjs.org/unzip
npm http 304 https://registry.npmjs.org/rimraf
npm http 304 https://registry.npmjs.org/unzip
npm http GET https://registry.npmjs.org/graceful-fs
npm http GET https://registry.npmjs.org/fstream
npm http GET https://registry.npmjs.org/pullstream/0.0.4
npm http GET https://registry.npmjs.org/binary
npm http 304 https://registry.npmjs.org/graceful-fs
npm http 304 https://registry.npmjs.org/binary
npm http 304 https://registry.npmjs.org/fstream
npm http 304 https://registry.npmjs.org/pullstream/0.0.4
npm http GET https://registry.npmjs.org/over
npm http GET https://registry.npmjs.org/stream-buffers
npm http GET https://registry.npmjs.org/mkdirp
npm http GET https://registry.npmjs.org/graceful-fs
npm http GET https://registry.npmjs.org/inherits
npm http GET https://registry.npmjs.org/chainsaw
npm http GET https://registry.npmjs.org/buffers
npm http 304 https://registry.npmjs.org/inherits
npm http 304 https://registry.npmjs.org/mkdirp
npm http 304 https://registry.npmjs.org/over
npm http 304 https://registry.npmjs.org/stream-buffers
npm http 304 https://registry.npmjs.org/graceful-fs
npm http 304 https://registry.npmjs.org/chainsaw
npm http 304 https://registry.npmjs.org/buffers
npm http GET https://registry.npmjs.org/traverse
npm http 304 https://registry.npmjs.org/traverse

> phantomjs@0.2.1 install /Users/cowboy/Dropbox/Projects/repos/gruntjs/tmp/node_modules/phantomjs
> node install.js

Requesting /Users/cowboy/Dropbox/Projects/repos/gruntjs/tmp/node_modules/phantomjs/tmp/phantomjs-1.7.0-macosx.zip
Receiving...
Recieved 782K...
Recieved 1564K...
Recieved 2346K...
Recieved 3129K...
Recieved 3911K...
Recieved 4694K...
Recieved 5476K...
Recieved 6258K...
Recieved 7041K...
Recieved 7823K...
Recieved 8606K...
Recieved 9388K...
Recieved 10170K...
Recieved 10182K total.
Extracting zip contents
Renaming extracted folder phantomjs-1.7.0-macosx  -> phantom
Done
phantomjs@0.2.1 node_modules/phantomjs
├── rimraf@2.0.2 (graceful-fs@1.1.14)
└── unzip@0.0.4 (pullstream@0.0.4, fstream@0.1.19, binary@0.3.0)

$ node -pe 'require("phantomjs").path'
/Users/cowboy/Dropbox/Projects/repos/gruntjs/tmp/node_modules/phantomjs/lib/phantom/bin/phantomjs

$ /Users/cowboy/Dropbox/Projects/repos/gruntjs/tmp/node_modules/phantomjs/lib/phantom/bin/phantomjs
-bash: /Users/cowboy/Dropbox/Projects/repos/gruntjs/tmp/node_modules/phantomjs/lib/phantom/bin/phantomjs: Permission denied

$ chmod +x /Users/cowboy/Dropbox/Projects/repos/gruntjs/tmp/node_modules/phantomjs/lib/phantom/bin/phantomjs

$ /Users/cowboy/Dropbox/Projects/repos/gruntjs/tmp/node_modules/phantomjs/lib/phantom/bin/phantomjs
phantomjs>

Closing comment (2012-10-25T19:58:54Z): I think this is now a dupe of #11.  I can confirm that your examples also fail for me. Weirdly we've been able to use the binary as is without issues.
I'll try and find time today to add a patch which forces the binary executable, while we wait on the unzip fix..