Medium / phantomjs

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

npm update should check for existing binary at target #532

Closed agroszer closed 8 years ago

agroszer commented 8 years ago

as it looks only npm install checks that, npm update just complains about PhantomJS not found on PATH

thus subsequent npm update's would download the binary again

adi@ebi: $ npm update

> phantomjs-prebuilt@2.1.6 install /work/shoobx/shoobx.app/node_modules/phantomjs-prebuilt
> node install.js

PhantomJS not found on PATH
Download already available at /tmp/phantomjs/phantomjs-1.9.8-shoobx.1-linux-x86_64.zip
Verified checksum of previously downloaded file
Extracting zip contents
Removing /work/shoobx/shoobx.app/node_modules/phantomjs-prebuilt/lib/phantom
Copying extracted folder /tmp/phantomjs/phantomjs-1.9.8-shoobx.1-linux-x86_64.zip-extract-1460624920495/phantomjs-1.9.8-shoobx.1-linux-x86_64 -> /work/shoobx/shoobx.app/node_modules/phantomjs-prebuilt/lib/phantom
Writing location.js file
Done. Phantomjs binary available at /work/shoobx/shoobx.app/node_modules/phantomjs-prebuilt/lib/phantom/bin/phantomjs
shoobx.app@1.0.0 /work/shoobx/shoobx.app
├── bower@1.7.9 
├── phantomjs-prebuilt@2.1.6  (git://github.com/shoobx/phantomjs-prebuilt.git#f17acd6f01ad7715cfffd6e3a32b990e394db97b)
└── plato-form@0.0.1  (git://github.com/shoobx/plato-form.git#e46117b4116423f8f42784389fc46f56e1750abd)

adi@ebi: $ npm update

> phantomjs-prebuilt@2.1.6 install /work/shoobx/shoobx.app/node_modules/phantomjs-prebuilt
> node install.js

PhantomJS not found on PATH
Download already available at /tmp/phantomjs/phantomjs-1.9.8-shoobx.1-linux-x86_64.zip
Verified checksum of previously downloaded file
Extracting zip contents
Removing /work/shoobx/shoobx.app/node_modules/phantomjs-prebuilt/lib/phantom
Copying extracted folder /tmp/phantomjs/phantomjs-1.9.8-shoobx.1-linux-x86_64.zip-extract-1460624978632/phantomjs-1.9.8-shoobx.1-linux-x86_64 -> /work/shoobx/shoobx.app/node_modules/phantomjs-prebuilt/lib/phantom
Writing location.js file
Done. Phantomjs binary available at /work/shoobx/shoobx.app/node_modules/phantomjs-prebuilt/lib/phantom/bin/phantomjs
shoobx.app@1.0.0 /work/shoobx/shoobx.app
├── phantomjs-prebuilt@2.1.6  (git://github.com/shoobx/phantomjs-prebuilt.git#f17acd6f01ad7715cfffd6e3a32b990e394db97b)
└── plato-form@0.0.1  (git://github.com/shoobx/plato-form.git#e46117b4116423f8f42784389fc46f56e1750abd)
nicks commented 8 years ago

This is not technically feasible. npm update wipes out the directory before it updates the package. And I think that because you're using git hashes in your package.json, you're short-circuiting npm's ability to do a no-op when the package hasn't changed.