mikedeboer / jsDAV

jsDAV allows you to easily add WebDAV support to a NodeJS application. jsDAV is meant to cover the entire standard, and attempts to allow integration using an easy to understand API.
http://www.mikedeboer.nl
MIT License
681 stars 159 forks source link

Node 0.12 compatibility (gnu-tools) #119

Open FND opened 9 years ago

FND commented 9 years ago

It appears that the gnu-tools package isn't available for Node v0.12 (manually installing it raises ELIFECYCLE).

While that package is listed as an optional dependency, it seems to be loaded regardless:

#!/usr/bin/env node

var jsDAV = require("jsDAV/lib/jsdav");

jsDAV.createServer({ node: __dirname }, 8000);
$ ./server
[...]
Error: Cannot find module 'gnu-tools'
    at Function.Module._resolveFilename (module.js:336:15)
    at Function.Module._load (module.js:278:25)
    at Module.require (module.js:365:17)
    at require (module.js:384:17)
    at Object.<anonymous> (.../node_modules/jsDAV/lib/DAV/plugins/codesearch.js:15:16)
[...]
mikedeboer commented 9 years ago

Hmm, you're right. It should be changed to optionally include the module. I'll try to do this soonish, but a PR might be faster.

FND commented 9 years ago

I'd tried fixing this myself, but couldn't quite figure out where the "codesearch" plugin is activated in the first place. Might give it another try later this week though.

FND commented 9 years ago

Related: Attempting to install the current HEAD (npm install "git+https://github.com/mikedeboer/jsDAV.git" - required for ETags; cf. #111) fails due to the time package being outdated. Upgrading to v0.11.1 should (cf. #120) fix this installation issue.

paroga commented 9 years ago

122 should fix this problem

FND commented 9 years ago

Thanks @paroga - testing with a local copy that includes both #122 and #123, things seem to be working fine again:

$ ./server
[info] jsDAV cannot load plugin 'codesearch': Cannot find module 'gnu-tools'
[info] jsDAV cannot load plugin 'filelist': Cannot find module 'gnu-tools'
[info] jsDAV cannot load plugin 'filesearch': Cannot find module 'gnu-tools'
[info] jsDAV server running on http://127.0.0.1:8000

It'd be good to get someone else to confirm this, but feel free to close the issue either way.