zotero / citeproc-js-server

Web service to generate citations and bibliographies using citeproc-js
Other
60 stars 39 forks source link

update required for node v0.9 and newer #8

Closed pietsch closed 10 years ago

pietsch commented 11 years ago

After much experimentation with nvm (the node version manager), I found out that the current (git tip) version of citeproc-node does not run with node v0.9 or newer. This should be documented somewhere. As the current node release is v0.10.4, it would be great have a citeproc-node that works with this version.

For the record, I tried the current version of citeproc-node successfully (but superficially) with node v0.8.23, v0.8.10, v0.6.21, and v0.4.12.

fcheslack commented 11 years ago

Thanks for the heads up. I suspected that might be the case based on some of the release notes but haven't checked again since immediately after 0.10 was released (when several dependent packages also hadn't been updated yet). I'll try to get to this in the near future.

Klortho commented 10 years ago

Hi, I just tried this out, and I see that it's not working out-of-the-box for me. I'm running node v0.10.9, so I guess this is the cause of the problem. Just to check: the incompatibility is with citeproc-js, is that right? I will try to take a look to see if I can figure it out.

pietsch commented 10 years ago

Frankly, I cannot remember whether the problem is in citeproc-node or in citeproc-js. Have you found out more in the meantime?

Klortho commented 10 years ago

Yes. I did a lot of work on it last week. I couldn't find the problem right away, so I started going through all the code line-by-line, and I made a lot of changes. I gave it a pretty thorough once-over, and cleaned up a bunch of things. It now works great on the new version of node, but I haven't tested it on the old, so I'm not sure if some of my changes didn't break it for older versions. I'm about to submit a pull request, and you can decide if you like my refactoring or not.

In case not, the reason it wasn't working on the new version of Node was because of this line. In the new version of node, urlObj.host is null rather than undefined.