Medium / phantomjs

NPM wrapper for installing phantomjs
Other
1.42k stars 436 forks source link

npm version mismatch #691

Closed dudash closed 7 years ago

dudash commented 7 years ago

I've noticed on my machine (and also in some of the logs of unrelated issues here) that the version of phantomjs that gets installed doesn't match the npm version desired. It always seems to pull the 2.1.1 version. Check out details of trying to get latest and instead getting 2.1.1 here:

jdudash-OSX:temp jason$ npm install phantomjs-prebuilt
\
> phantomjs-prebuilt@2.1.14 install /Users/jason/Downloads/temp/node_modules/phantomjs-prebuilt
> node install.js

PhantomJS not found on PATH
Download already available at /var/folders/nk/_pwvxybn53n9zbm8411ygrym0000gn/T/phantomjs/phantomjs-2.1.1-macosx.zip
Verified checksum of previously downloaded file
Extracting zip contents
Removing /Users/jason/Downloads/temp/node_modules/phantomjs-prebuilt/lib/phantom
Copying extracted folder /var/folders/nk/_pwvxybn53n9zbm8411ygrym0000gn/T/phantomjs/phantomjs-2.1.1-macosx.zip-extract-1493304992696/phantomjs-2.1.1-macosx -> /Users/jason/Downloads/temp/node_modules/phantomjs-prebuilt/lib/phantom
Writing location.js file
Done. Phantomjs binary available at /Users/jason/Downloads/temp/node_modules/phantomjs-prebuilt/lib/phantom/bin/phantomjs
phantomjs-prebuilt@2.1.14 node_modules/phantomjs-prebuilt
├── progress@1.1.8
├── kew@0.7.0
├── es6-promise@4.0.5
├── which@1.2.14 (isexe@2.0.0)
├── request-progress@2.0.1 (throttleit@1.0.0)
├── hasha@2.2.0 (is-stream@1.1.0, pinkie-promise@2.0.1)
├── fs-extra@1.0.0 (graceful-fs@4.1.11, jsonfile@2.4.0, klaw@1.3.1)
├── extract-zip@1.5.0 (debug@0.7.4, yauzl@2.4.1, mkdirp@0.5.0, concat-stream@1.5.0)
└── request@2.79.0 (tunnel-agent@0.4.3, forever-agent@0.6.1, oauth-sign@0.8.2, aws-sign2@0.6.0, caseless@0.11.0, is-typedarray@1.0.0, stringstream@0.0.5, aws4@1.6.0, isstream@0.1.2, json-stringify-safe@5.0.1, extend@3.0.0, uuid@3.0.1, qs@6.3.2, mime-types@2.1.15, combined-stream@1.0.5, tough-cookie@2.3.2, form-data@2.1.4, hawk@3.1.3, http-signature@1.1.1, har-validator@2.0.6)
jdudash-OSX:temp jason$ ./node_modules/phantomjs-prebuilt/bin/phantomjs -v
2.1.1

And even when I clean everything out, it still does that. See below for another log:

jdudash-OSX:temp jason$ npm uninstall phantomjs-prebuilt
unbuild phantomjs-prebuilt@2.1.14
jdudash-OSX:temp jason$ npm cache clean
jdudash-OSX:temp jason$ rm -rf /var/folders/nk/_pwvxybn53n9zbm8411ygrym0000gn/T/phantomjs/phantomjs-2.1.1-macosx.zip
jdudash-OSX:temp jason$ rm -rf /var/folders/nk/_pwvxybn53n9zbm8411ygrym0000gn/T/phantomjs/
jdudash-OSX:temp jason$ npm list
/Users/jason/Downloads/temp
└── (empty)

jdudash-OSX:temp jason$ npm install phantomjs-prebuilt
-
> phantomjs-prebuilt@2.1.14 install /Users/jason/Downloads/temp/node_modules/phantomjs-prebuilt
> node install.js

PhantomJS not found on PATH
Downloading https://github.com/Medium/phantomjs/releases/download/v2.1.1/phantomjs-2.1.1-macosx.zip
Saving to /var/folders/nk/_pwvxybn53n9zbm8411ygrym0000gn/T/phantomjs/phantomjs-2.1.1-macosx.zip
Receiving...
  [================================--------] 80%
Received 16746K total.
Extracting zip contents
Removing /Users/jason/Downloads/temp/node_modules/phantomjs-prebuilt/lib/phantom
Copying extracted folder /var/folders/nk/_pwvxybn53n9zbm8411ygrym0000gn/T/phantomjs/phantomjs-2.1.1-macosx.zip-extract-1493305301935/phantomjs-2.1.1-macosx -> /Users/jason/Downloads/temp/node_modules/phantomjs-prebuilt/lib/phantom
Writing location.js file
Done. Phantomjs binary available at /Users/jason/Downloads/temp/node_modules/phantomjs-prebuilt/lib/phantom/bin/phantomjs
phantomjs-prebuilt@2.1.14 node_modules/phantomjs-prebuilt
├── progress@1.1.8
├── kew@0.7.0
├── es6-promise@4.0.5
├── which@1.2.14 (isexe@2.0.0)
├── request-progress@2.0.1 (throttleit@1.0.0)
├── fs-extra@1.0.0 (klaw@1.3.1, jsonfile@2.4.0, graceful-fs@4.1.11)
├── hasha@2.2.0 (is-stream@1.1.0, pinkie-promise@2.0.1)
├── extract-zip@1.5.0 (debug@0.7.4, mkdirp@0.5.0, yauzl@2.4.1, concat-stream@1.5.0)
└── request@2.79.0 (aws-sign2@0.6.0, tunnel-agent@0.4.3, oauth-sign@0.8.2, forever-agent@0.6.1, caseless@0.11.0, is-typedarray@1.0.0, stringstream@0.0.5, aws4@1.6.0, isstream@0.1.2, json-stringify-safe@5.0.1, extend@3.0.0, uuid@3.0.1, qs@6.3.2, combined-stream@1.0.5, mime-types@2.1.15, tough-cookie@2.3.2, form-data@2.1.4, hawk@3.1.3, http-signature@1.1.1, har-validator@2.0.6)
jdudash-OSX:temp jason$ ./node_modules/phantomjs-prebuilt/bin/phantomjs -v
2.1.1
nicks commented 7 years ago

This is working as intended, as described in the README: https://github.com/Medium/phantomjs#versioning