ContentMine / quickscrape

A scraping command line tool for the modern web
MIT License
259 stars 43 forks source link

New installation on Ubuntu 14.04 gives TypeError #24

Closed tsparkinson closed 10 years ago

tsparkinson commented 10 years ago

I've just tried to install quickscrape on a VM (Ubuntu 14.04) using the Ubuntu instructions in README.md.

Although there were warnings I believed the installation completed successfully. However when I execute the example (peer-384) I get an immediate error message:

/usr/lib/node_modules/quickscrape/bin/quickscrape.js:97 var scrapers = new ScraperBox(program.scraperdir); ^ TypeError: undefined is not a function at Object. (/usr/lib/node_modules/quickscrape/bin/quickscrape.js:97:16)

which I interpret as a failure to have found 'thresher' but I confess I have never installed Node.js before and have little Javascript expertise (but I am well used to installing and configuring and programming other stuff).

I suspect that I made some trivial mistake. I may have done sudo bash at one point and run a step as root with root home rather than me with my home and that seems to matter to npm.

Can you spot anything from the installation, execution, npm ls below?

regards

Tim Parkinson University of Southampton

==============Cut and Pasted from Installation Window =====================

tsp@bft:~/scraping$ sudo -H npm install --global quickscrape npm WARN engine hawk@0.10.2: wanted: {"node":"0.8.x"} (current: {"node":"v0.10.29","npm":"1.4.14"}) npm WARN engine cryptiles@0.1.3: wanted: {"node":"0.8.x"} (current: {"node":"v0.10.29","npm":"1.4.14"}) npm WARN engine boom@0.3.8: wanted: {"node":"0.8.x"} (current: {"node":"v0.10.29","npm":"1.4.14"}) npm WARN engine hoek@0.7.6: wanted: {"node":"0.8.x"} (current: {"node":"v0.10.29","npm":"1.4.14"}) npm WARN engine sntp@0.1.4: wanted: {"node":"0.8.x"} (current: {"node":"v0.10.29","npm":"1.4.14"})

contextify@0.1.8 install /usr/lib/node_modules/quickscrape/node_modules/thresher/node_modules/jsdom/node_modules/contextify node-gyp rebuild

gyp WARN EACCES user "root" does not have permission to access the dev dir "/root/.node-gyp/0.10.29" gyp WARN EACCES attempting to reinstall using temporary dev dir "/usr/lib/node_modules/quickscrape/node_modules/thresher/node_modules/jsdom/node_modules/contextify/.node-gyp" make: Entering directory /usr/lib/node_modules/quickscrape/node_modules/thresher/node_modules/jsdom/node_modules/contextify/build' CXX(target) Release/obj.target/contextify/src/contextify.o SOLINK_MODULE(target) Release/obj.target/contextify.node SOLINK_MODULE(target) Release/obj.target/contextify.node: Finished COPY Release/contextify.node make: Leaving directory/usr/lib/node_modules/quickscrape/node_modules/thresher/node_modules/jsdom/node_modules/contextify/build'

phantomjs@1.9.7-15 install /usr/lib/node_modules/quickscrape/node_modules/thresher/node_modules/phantomjs node install.js

Downloading https://bitbucket.org/ariya/phantomjs/downloads/phantomjs-1.9.7-linux-x86_64.tar.bz2 Saving to /usr/lib/node_modules/quickscrape/node_modules/thresher/node_modules/phantomjs/phantomjs/phantomjs-1.9.7-linux-x86_64.tar.bz2 Receiving...

/usr/lib/node_modules/quickscrape/bin/quickscrape.js:97 var scrapers = new ScraperBox(program.scraperdir); ^ TypeError: undefined is not a function at Object. (/usr/lib/node_modules/quickscrape/bin/quickscrape.js:97:16) at Module._compile (module.js:456:26) at Object.Module._extensions..js (module.js:474:10) at Module.load (module.js:356:32) at Function.Module._load (module.js:312:12) at Function.Module.runMain (module.js:497:10) at startup (node.js:119:16) at node.js:906:3 tsp@bft:~/scraping$ sudo -H npm ls /home/tsp/scraping └── (empty)

tsp@bft:~/scraping$ sudo npm ls /home/tsp/scraping └── (empty)

tsp@bft:~/scraping$ cd tsp@bft:~$ sudo npm ls /home/tsp └── (empty)

tsp@bft:~$ sudo npm ls --global /usr/lib ├─┬ npm@1.4.14 │ ├── abbrev@1.0.5 │ ├── ansi@0.2.1 │ ├── ansicolors@0.3.2 │ ├── ansistyles@0.1.3 │ ├── archy@0.0.2 │ ├── block-stream@0.0.7 │ ├── char-spinner@1.0.1 │ ├── child-process-close@0.1.1 │ ├── chmodr@0.1.0 │ ├── chownr@0.0.1 │ ├── cmd-shim@1.1.1 │ ├── columnify@0.1.2 │ ├── editor@0.0.5 │ ├── fstream@0.1.25 │ ├─┬ fstream-npm@0.1.7 │ │ └── fstream-ignore@0.0.8 │ ├── github-url-from-git@1.1.1 │ ├── github-url-from-username-repo@0.1.0 │ ├── glob@3.2.10 │ ├── graceful-fs@2.0.2 │ ├── inflight@1.0.1 │ ├── inherits@2.0.1 │ ├── ini@1.2.0 │ ├─┬ init-package-json@0.0.17 │ │ └── promzard@0.2.2 │ ├── lockfile@0.4.2 │ ├── lru-cache@2.5.0 │ ├─┬ minimatch@0.3.0 │ │ └── sigmund@1.0.0 │ ├── mkdirp@0.3.5 │ ├── node-gyp@0.13.1 │ ├── nopt@2.2.1 │ ├── npm-cache-filename@1.0.1 │ ├── npm-install-checks@1.0.1 │ ├── npm-registry-client@1.0.0 │ ├── npm-user-validate@0.1.0 │ ├─┬ npmconf@1.0.1 │ │ └─┬ config-chain@1.1.8 │ │ └── proto-list@1.2.2 │ ├── npmlog@0.0.6 │ ├── once@1.3.0 │ ├── opener@1.3.0 │ ├── osenv@0.0.3 │ ├── path-is-inside@1.0.1 │ ├─┬ read@1.0.5 │ │ └── mute-stream@0.0.4 │ ├─┬ read-installed@2.0.4 │ │ └── util-extend@1.0.1 │ ├─┬ read-package-json@1.1.9 │ │ └── normalize-package-data@0.2.13 │ ├─┬ request@2.30.0 │ │ ├── aws-sign2@0.5.0 │ │ ├── forever-agent@0.5.0 │ │ ├─┬ form-data@0.1.2 │ │ │ ├── async@0.2.9 │ │ │ └─┬ combined-stream@0.0.4 │ │ │ └── delayed-stream@0.0.5 │ │ ├─┬ hawk@1.0.0 │ │ │ ├── boom@0.4.2 │ │ │ ├── cryptiles@0.2.2 │ │ │ ├── hoek@0.9.1 │ │ │ └── sntp@0.2.4 │ │ ├─┬ http-signature@0.10.0 │ │ │ ├── asn1@0.1.11 │ │ │ ├── assert-plus@0.1.2 │ │ │ └── ctype@0.5.2 │ │ ├── json-stringify-safe@5.0.0 │ │ ├── mime@1.2.11 │ │ ├── node-uuid@1.4.1 │ │ ├── oauth-sign@0.3.0 │ │ ├── qs@0.6.6 │ │ ├─┬ tough-cookie@0.9.15 │ │ │ └── punycode@1.2.3 │ │ └── tunnel-agent@0.3.0 │ ├── retry@0.6.0 │ ├── rimraf@2.2.6 │ ├── semver@2.3.0 │ ├─┬ sha@1.2.3 │ │ └── readable-stream@1.0.24 │ ├── slide@1.1.5 │ ├── sorted-object@1.0.0 │ ├── tar@0.1.19 │ ├── text-table@0.2.0 │ ├── uid-number@0.0.5 │ └── which@1.0.5 └─┬ quickscrape@0.2.7 ├── commander@2.2.0 ├─┬ thresher@0.0.9 │ ├── casperjs@1.1.0-beta3 │ ├─┬ download@0.1.18 │ │ ├─┬ decompress@0.2.4 │ │ │ ├── adm-zip@0.4.4 │ │ │ ├─┬ extname@0.1.2 │ │ │ │ ├── ext-list@0.1.0 │ │ │ │ └── underscore.string@2.3.3 │ │ │ ├─┬ map-key@0.1.4 │ │ │ │ ├── lodash@2.4.1 │ │ │ │ └── underscore.string@2.3.3 │ │ │ ├── rimraf@2.2.8 │ │ │ ├─┬ stream-combiner@0.0.4 │ │ │ │ └── duplexer@0.1.1 │ │ │ ├─┬ tar@0.1.20 │ │ │ │ ├── block-stream@0.0.7 │ │ │ │ ├─┬ fstream@0.1.29 │ │ │ │ │ └── graceful-fs@3.0.2 │ │ │ │ └── inherits@2.0.1 │ │ │ └─┬ tempfile@0.1.3 │ │ │ └── uuid@1.4.1 │ │ ├── each-async@0.1.3 │ │ ├── get-stdin@0.1.0 │ │ ├── get-urls@0.1.2 │ │ ├── mkdirp@0.3.5 │ │ ├─┬ nopt@2.2.1 │ │ │ └── abbrev@1.0.5 │ │ └─┬ through2@0.4.2 │ │ ├─┬ readable-stream@1.0.27-1 │ │ │ ├── core-util-is@1.0.1 │ │ │ ├── inherits@2.0.1 │ │ │ ├── isarray@0.0.1 │ │ │ └── string_decoder@0.10.25-1 │ │ └─┬ xtend@2.1.2 │ │ └── object-keys@0.4.0 │ ├─┬ jsdom@0.11.1 │ │ ├─┬ contextify@0.1.8 │ │ │ ├── bindings@1.2.1 │ │ │ └── nan@1.0.0 │ │ ├── cssom@0.3.0 │ │ ├── cssstyle@0.2.14 │ │ ├─┬ htmlparser2@3.7.3 │ │ │ ├── domelementtype@1.1.1 │ │ │ ├── domhandler@2.2.0 │ │ │ ├── domutils@1.5.0 │ │ │ ├── entities@1.0.0 │ │ │ └─┬ readable-stream@1.1.13-1 │ │ │ ├── core-util-is@1.0.1 │ │ │ ├── inherits@2.0.1 │ │ │ ├── isarray@0.0.1 │ │ │ └── string_decoder@0.10.25-1 │ │ ├── nwmatcher@1.3.3 │ │ └── xmlhttprequest@1.6.0 │ ├─┬ jsdom-little@0.10.5 │ │ ├── cssom@0.3.0 │ │ ├── cssstyle@0.2.14 │ │ ├─┬ htmlparser2@3.7.3 │ │ │ ├── domelementtype@1.1.1 │ │ │ ├── domhandler@2.2.0 │ │ │ ├── domutils@1.5.0 │ │ │ ├── entities@1.0.0 │ │ │ └─┬ readable-stream@1.1.13-1 │ │ │ ├── core-util-is@1.0.1 │ │ │ ├── inherits@2.0.1 │ │ │ ├── isarray@0.0.1 │ │ │ └── string_decoder@0.10.25-1 │ │ └── nwmatcher@1.3.3 │ ├─┬ phantomjs@1.9.7-15 │ │ ├── adm-zip@0.2.1 │ │ ├── kew@0.1.7 │ │ ├── mkdirp@0.3.5 │ │ ├── ncp@0.4.2 │ │ ├─┬ npmconf@0.0.24 │ │ │ ├─┬ config-chain@1.1.8 │ │ │ │ └── proto-list@1.2.3 │ │ │ ├── inherits@1.0.0 │ │ │ ├── ini@1.1.0 │ │ │ ├─┬ nopt@2.2.1 │ │ │ │ └── abbrev@1.0.5 │ │ │ ├── once@1.1.1 │ │ │ ├── osenv@0.0.3 │ │ │ └── semver@1.1.4 │ │ ├── progress@1.1.7 │ │ ├─┬ request@2.36.0 │ │ │ ├── aws-sign2@0.5.0 │ │ │ ├── forever-agent@0.5.2 │ │ │ ├─┬ form-data@0.1.4 │ │ │ │ ├── async@0.9.0 │ │ │ │ └─┬ combined-stream@0.0.5 │ │ │ │ └── delayed-stream@0.0.5 │ │ │ ├─┬ hawk@1.0.0 │ │ │ │ ├── boom@0.4.2 │ │ │ │ ├── cryptiles@0.2.2 │ │ │ │ ├── hoek@0.9.1 │ │ │ │ └── sntp@0.2.4 │ │ │ ├─┬ http-signature@0.10.0 │ │ │ │ ├── asn1@0.1.11 │ │ │ │ ├── assert-plus@0.1.2 │ │ │ │ └── ctype@0.5.2 │ │ │ ├── json-stringify-safe@5.0.0 │ │ │ ├── mime@1.2.11 │ │ │ ├── node-uuid@1.4.1 │ │ │ ├── oauth-sign@0.3.0 │ │ │ ├── qs@0.6.6 │ │ │ ├─┬ tough-cookie@0.12.1 │ │ │ │ └── punycode@1.3.0 │ │ │ └── tunnel-agent@0.4.0 │ │ ├─┬ request-progress@0.3.1 │ │ │ └── throttleit@0.0.2 │ │ └── rimraf@2.2.8 │ ├─┬ request@2.37.0 │ │ ├── aws-sign2@0.5.0 │ │ ├── forever-agent@0.5.2 │ │ ├─┬ form-data@0.1.4 │ │ │ ├── async@0.9.0 │ │ │ ├─┬ combined-stream@0.0.5 │ │ │ │ └── delayed-stream@0.0.5 │ │ │ └── mime@1.2.11 │ │ ├─┬ hawk@1.1.1 │ │ │ ├── boom@0.4.2 │ │ │ ├── cryptiles@0.2.2 │ │ │ ├── hoek@0.9.1 │ │ │ └── sntp@0.2.4 │ │ ├─┬ http-signature@0.10.0 │ │ │ ├── asn1@0.1.11 │ │ │ ├── assert-plus@0.1.2 │ │ │ └── ctype@0.5.2 │ │ ├── json-stringify-safe@5.0.0 │ │ ├── mime-types@1.0.1 │ │ ├── node-uuid@1.4.1 │ │ ├── oauth-sign@0.3.0 │ │ ├── qs@0.6.6 │ │ ├─┬ tough-cookie@0.12.1 │ │ │ └── punycode@1.3.0 │ │ └── tunnel-agent@0.4.0 │ ├── shelljs@0.3.0 │ ├─┬ spooky@0.2.4 │ │ ├── async@0.1.22 │ │ ├── carrier@0.1.14 │ │ ├── duplexer@0.0.4 │ │ ├─┬ readable-stream@1.0.27-1 │ │ │ ├── core-util-is@1.0.1 │ │ │ ├── inherits@2.0.1 │ │ │ ├── isarray@0.0.1 │ │ │ └── string_decoder@0.10.25-1 │ │ ├── tiny-jsonrpc@0.2.1 │ │ └── underscore@1.3.3 │ └── xpath@0.0.6 ├── which@1.0.5 └─┬ winston@0.7.3 ├── async@0.2.10 ├── colors@0.6.2 ├── cycle@1.0.3 ├── eyes@0.1.8 ├── pkginfo@0.3.0 ├─┬ request@2.16.6 │ ├── aws-sign@0.2.0 │ ├── cookie-jar@0.2.0 │ ├── forever-agent@0.2.0 │ ├─┬ form-data@0.0.10 │ │ └─┬ combined-stream@0.0.5 │ │ └── delayed-stream@0.0.5 │ ├─┬ hawk@0.10.2 │ │ ├── boom@0.3.8 │ │ ├── cryptiles@0.1.3 │ │ ├── hoek@0.7.6 │ │ └── sntp@0.1.4 │ ├── json-stringify-safe@3.0.0 │ ├── mime@1.2.11 │ ├── node-uuid@1.4.1 │ ├── oauth-sign@0.2.0 │ ├── qs@0.5.6 │ └── tunnel-agent@0.2.0 └── stack-trace@0.0.9

Mec-iS commented 10 years ago

The issue can be solved like #25

blahah commented 10 years ago

Solved in @Mec-iS's PR #26.

tsparkinson commented 10 years ago

I've patched my /usr/lib/node_modules/quickscrape/bin/quickscrape.js to match your fix (npm update didn't seem to do anything - I think you need to bump the version string before update will consider it needs to act).

I confirm that the peerj example now runs to completion.

Thanks for your help.

blahah commented 10 years ago

the new version hasn't been released yet - I've got couple of other fixes I wanted to include, but if people are relying on it I will push the new version to npm today

tsparkinson commented 10 years ago

No rush from us.

TSP

From: Richard Smith-Unna [mailto:notifications@github.com] Sent: 04 August 2014 15:55 To: ContentMine/quickscrape Cc: Tim Parkinson Subject: {Disarmed} Re: [quickscrape] New installation on Ubuntu 14.04 gives TypeError (#24)

the new version hasn't been released yet - I've got couple of other fixes I wanted to include, but if people are relying on it I will push the new version to npm today

— Reply to this email directly or view it on GitHubhttps://github.com/ContentMine/quickscrape/issues/24#issuecomment-51070613.