ContentMine / getpapers

Get metadata, fulltexts or fulltext URLs of papers matching a search query
MIT License
197 stars 37 forks source link

Installation needs extra guidance for Ubuntu users #141

Closed rossmounce closed 7 years ago

rossmounce commented 7 years ago

The readme makes it seem like

npm install --global getpapers

is all one needs to install getpapers , well... it wasn't for me!

nodejs is massively outdated in the ubuntu repositories. It would be good to mention that nodejs > 4.0 is required for successful installation of getpapers.

When I tried the described installation method (on a Ubuntu 16.04.1 machine) I get output that doesn't obviously flag that the install wasn't successful (although if one reads the warnings it's clear that my machine didn't have a new enough version of npm):

$ npm install --global getpapers
npm WARN engine matched@0.4.4: wanted: {"node":">= 0.12.0"} (current: {"node":"0.10.46","npm":"2.15.1"})
npm WARN engine xmlbuilder@8.2.2: wanted: {"node":">=4.0"} (current: {"node":"0.10.46","npm":"2.15.1"})
npm WARN deprecated node-uuid@1.4.7: use uuid module instead
npm WARN deprecated tough-cookie@2.2.2: ReDoS vulnerability parsing Set-Cookie https://nodesecurity.io/advisories/130
npm WARN engine request@2.79.0: wanted: {"node":">= 4"} (current: {"node":"0.10.46","npm":"2.15.1"})
npm WARN engine form-data@2.1.2: wanted: {"node":">= 0.12"} (current: {"node":"0.10.46","npm":"2.15.1"})
/home/ross/.nvm/v0.10.46/bin/getpapers -> /home/ross/.nvm/v0.10.46/lib/node_modules/getpapers/bin/getpapers.js
getpapers@0.4.10 /home/ross/.nvm/v0.10.46/lib/node_modules/getpapers
├── progress@1.1.8
├── semver@5.3.0
├── commander@2.7.1 (graceful-readlink@1.0.1)
├── chalk@1.0.0 (escape-string-regexp@1.0.5, ansi-styles@2.2.1, supports-color@1.3.1, strip-ansi@2.0.1, has-ansi@1.0.3)
├── mkdirp@0.5.1 (minimist@0.0.8)
├── sanitize-filename@1.6.1 (truncate-utf8-bytes@1.0.2)
├── got@2.9.2 (lowercase-keys@1.0.0, timed-out@2.0.0, prepend-http@1.0.4, is-stream@1.1.0, object-assign@2.1.1, infinity-agent@2.0.3, statuses@1.3.1, nested-error-stacks@1.0.2, read-all-stream@2.2.0, duplexify@3.5.0)
├── matched@0.4.4 (is-valid-glob@0.3.0, async-array-reduce@0.2.1, fs-exists-sync@0.1.0, arr-union@3.1.0, extend-shallow@2.0.1, has-glob@0.1.1, lazy-cache@2.0.2, glob@7.1.1, resolve-dir@0.1.1)
├── winston@1.0.2 (cycle@1.0.3, stack-trace@0.0.9, eyes@0.1.8, isstream@0.1.2, pkginfo@0.3.1, async@1.0.0, colors@1.0.3)
├── restler@3.4.0 (yaml@0.2.3, qs@1.2.0, iconv-lite@0.2.11, xml2js@0.4.0)
├── lodash@3.10.1
├── xml2js@0.4.17 (sax@1.2.1, xmlbuilder@4.2.1)
├── requestretry@1.12.0 (extend@3.0.0, request@2.79.0, when@3.7.7, lodash@4.17.2)
└── crossref@0.1.2 (got@5.1.0, request@2.65.0)

The solution I found after many failed attempts was to use nvm which fixed it for me

nvm install 4.0
nvm use 4.0
$ npm install --global getpapers
npm WARN deprecated node-uuid@1.4.7: use uuid module instead
npm WARN deprecated tough-cookie@2.2.2: ReDoS vulnerability parsing Set-Cookie https://nodesecurity.io/advisories/130
/home/ross/.nvm/versions/node/v4.0.0/bin/getpapers -> /home/ross/.nvm/versions/node/v4.0.0/lib/node_modules/getpapers/bin/getpapers.js
getpapers@0.4.10 /home/ross/.nvm/versions/node/v4.0.0/lib/node_modules/getpapers
├── progress@1.1.8
├── semver@5.3.0
├── commander@2.7.1 (graceful-readlink@1.0.1)
├── chalk@1.0.0 (escape-string-regexp@1.0.5, ansi-styles@2.2.1, supports-color@1.3.1, strip-ansi@2.0.1, has-ansi@1.0.3)
├── mkdirp@0.5.1 (minimist@0.0.8)
├── sanitize-filename@1.6.1 (truncate-utf8-bytes@1.0.2)
├── got@2.9.2 (lowercase-keys@1.0.0, timed-out@2.0.0, prepend-http@1.0.4, is-stream@1.1.0, object-assign@2.1.1, infinity-agent@2.0.3, statuses@1.3.1, nested-error-stacks@1.0.2, read-all-stream@2.2.0, duplexify@3.5.0)
├── matched@0.4.4 (is-valid-glob@0.3.0, fs-exists-sync@0.1.0, async-array-reduce@0.2.1, arr-union@3.1.0, extend-shallow@2.0.1, has-glob@0.1.1, lazy-cache@2.0.2, glob@7.1.1, resolve-dir@0.1.1)
├── winston@1.0.2 (cycle@1.0.3, stack-trace@0.0.9, eyes@0.1.8, isstream@0.1.2, pkginfo@0.3.1, async@1.0.0, colors@1.0.3)
├── restler@3.4.0 (yaml@0.2.3, qs@1.2.0, iconv-lite@0.2.11, xml2js@0.4.0)
├── lodash@3.10.1
├── xml2js@0.4.17 (sax@1.2.1, xmlbuilder@4.2.1)
├── requestretry@1.12.0 (extend@3.0.0, request@2.79.0, when@3.7.7, lodash@4.17.2)
└── crossref@0.1.2 (got@5.1.0, request@2.65.0)
ross@ross-x3:~/workspace/zzz$ getpapers

  Usage: getpapers [options]

  Options:

    -h, --help                output usage information
    -V, --version             output the version number
    -q, --query <query>       search query (required)
    -o, --outdir <path>       output directory (required - will be created if not found)
    --api <name>              API to search [eupmc, crossref, ieee, arxiv] (default: eupmc)
    -x, --xml                 download fulltext XMLs if available
    -p, --pdf                 download fulltext PDFs if available
    -s, --supp                download supplementary files if available
    -t, --minedterms          download text-mined terms if available
    -l, --loglevel <level>    amount of information to log (silent, verbose, info*, data, warn, error, or debug)
    -a, --all                 search all papers, not just open access
    -n, --noexecute           report how many results match the query, but don't actually download anything
    -f, --logfile <filename>  save log to specified file in output directory as well as printing to terminal
    -k, --limit <int>         limit the number of hits and downloads
    --filter <filter object>  filter by key value pair, passed straight to the crossref api only
    -r, --restart             restart file downloads after failure
tarrow commented 7 years ago

Sure, that would be a good thing to include. The minimum node version is currently missing.

We tried to steer as clear as possible of providing detailed instructions on how to install node for any particular environment since there isn't really one right way and there are a million different linux/unix flavours people might be coming to us with.

rossmounce commented 7 years ago

Understood. I was just surprised because it had worked for me before. Software changes; who knew eh? :smiley:

blahah commented 7 years ago

fixed https://github.com/ContentMine/getpapers#installation