ContentMine / getpapers

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

Potentially unhandled rejection [1] TypeError: Invalid Version: 4.5.3.1 #149

Closed rossmounce closed 7 years ago

rossmounce commented 7 years ago

Not sure what's going on here...

ross@ross-envy:~/workspace/contentmine/teststuff$ getpapers -V
0.4.10
ross@ross-envy:~/workspace/contentmine/teststuff$ node -v
v4.0.0
ross@ross-envy:~/workspace/contentmine/teststuff$ npm -v
3.10.8
ross@ross-envy:~/workspace/contentmine/teststuff$ getpapers -q aardvark -o aardvark -n
info: Searching using eupmc API
info: Running in no-execute mode, so nothing will be downloaded
info: Found 101 open access results
Potentially unhandled rejection [1] TypeError: Invalid Version: 4.5.3.1
    at new SemVer (/home/ross/.nvm/versions/node/v4.0.0/lib/node_modules/getpapers/node_modules/semver/semver.js:293:11)
    at Range.test (/home/ross/.nvm/versions/node/v4.0.0/lib/node_modules/getpapers/node_modules/semver/semver.js:1036:15)
    at Function.satisfies (/home/ross/.nvm/versions/node/v4.0.0/lib/node_modules/getpapers/node_modules/semver/semver.js:1085:16)
    at EuPmc.search.EuPmc.testApi (/home/ross/.nvm/versions/node/v4.0.0/lib/node_modules/getpapers/lib/eupmc.js:72:14)
    at EuPmc.search.EuPmc.completeCallback (/home/ross/.nvm/versions/node/v4.0.0/lib/node_modules/getpapers/lib/eupmc.js:132:11)
    at /home/ross/.nvm/versions/node/v4.0.0/lib/node_modules/getpapers/lib/eupmc.js:108:7
    at Parser.<anonymous> (/home/ross/.nvm/versions/node/v4.0.0/lib/node_modules/getpapers/node_modules/xml2js/lib/xml2js.js:489:18)
    at emitOne (events.js:77:13)
    at Parser.emit (events.js:169:7)
    at Object.onclosetag (/home/ross/.nvm/versions/node/v4.0.0/lib/node_modules/getpapers/node_modules/xml2js/lib/xml2js.js:447:26)
tarrow commented 7 years ago

EuPMC have updated their api (I guess this morning). They don't seem to have documented this and they've not given it a semantic version number. This means that when we parse the version number it fails.

I'll look at hacking together a patch.

tarrow commented 7 years ago

@rossmounce is this totally blocking your hackday? We're at the CM all hands meeting right now but I might be able to hack something together quickly if it is really urgent.

rossmounce commented 7 years ago

In the end I just navigated around it and focused more on quickscrape, explaining that getpapers will be fixed come January. Have seen these type of things come up before so am used to changing plans/focus at workshops :)

I delved in R and the rcrossref package in order to be able to get long lists of DOIs per journal to get people to feel they could utilise quickscrape at appropriate scale. When getpapers is back in action the crossref functionality in that will make getpapers (for links) -> quickscrape (for fulltext closed access papers) more smooth.

Fixing / probing #145 would be of more concern to me in the next few months (no need for immediacy) - that's potentially a big blocker for many use cases.