clux / modul8

NO LONGER MAINTAINED - browserify is too similar and is better (see issues)
http://clux.github.com/modul8
MIT License
22 stars 4 forks source link

npm dependency issue #11

Closed panosru closed 12 years ago

panosru commented 12 years ago

Hi, if you run npm install underscore before npm install backbone then backbone won't install underscore dependency locally since underscore exists but as a result when you try to do require('npm::backbone'); having .npm('./node_modules'); set you will get an error like the following:

DEBUG: Error: modul8 failed to require npm module underscore
    at /home/rnd/domains/design.rnd/public_html/app-ui/node_modules/modul8/lib/utils.js:8:9
    at Resolver.locate (/home/rnd/domains/design.rnd/public_html/app-ui/node_modules/modul8/lib/resolver.js:304:7)
    at /home/rnd/domains/design.rnd/public_html/app-ui/node_modules/modul8/lib/resolver.js:352:21
    at /home/rnd/domains/design.rnd/public_html/app-ui/node_modules/modul8/lib/analyzer.js:51:12
    at Array.map (native)
    at Analyzer.dependencies (/home/rnd/domains/design.rnd/public_html/app-ui/node_modules/modul8/lib/analyzer.js:50:28)
    at Analyzer.<anonymous> (/home/rnd/domains/design.rnd/public_html/app-ui/node_modules/modul8/lib/analyzer.js:95:27)
    at Analyzer.<anonymous> (/home/rnd/domains/design.rnd/public_html/app-ui/node_modules/modul8/lib/analyzer.js:116:15)
    at Analyzer.buildTree (/home/rnd/domains/design.rnd/public_html/app-ui/node_modules/modul8/lib/analyzer.js:120:9)
    at new Analyzer (/home/rnd/domains/design.rnd/public_html/app-ui/node_modules/modul8/lib/analyzer.js:26:8)
clux commented 12 years ago

Hm. I tried to design it so that this scenario specifically would work. I am surprised it does not. Will have a look at this.

clux commented 12 years ago

Works in my cwd but not in 0.15.0. Must have messed up something right before publish. Might publish a 0.15.1 to fix it later today.

Need to write a tester for this functionality really.

panosru commented 12 years ago

I'm glad you could reproduce it :) I'll wait for 0.15.1 then :D so far I just installed local dependencies for backbone even if I already have underscore in my main node_modules folder :)

clux commented 12 years ago

Checked in 0.15.1.

A bit of code was missing :/ This should fix your issue, and many similar ones.

But as with the rest of npm resolution code; it is very new and not very well tested at the moment. Will make a test tool for it asap. In the mean time, please let me know any issues that arise : )

panosru commented 12 years ago

@clux sorry for the late reply!! It seems to work fine now!! Thanks for taking care of the issue :)

modul8 is great!