volojs / volo

Create front end projects from templates, add dependencies, and automate the resulting projects
https://volojs.github.io/
Other
1.41k stars 99 forks source link

Globally installed volo cannot find locally installed modules #101

Closed dangmai closed 12 years ago

dangmai commented 12 years ago

I have a project structure that looks roughly like this: Project |-node_modules |-tools |-www |-www-built |-package.json |-volofile

If I install volo by npm install -g volo and in the project's volofile I require('volo-appcache') which is installed by npm install volo-appcache, then volo appcache complains about not finding the volo-appcache module. If, however, I install volo by npm install volo and do node ./node_modules/volo/bin/volo appcache, then the module is found correctly. I'd rather not do the second command as it's longer. Is there a way for globally-installed volo to look for locally installed modules then?

EDIT: I'm using Windows if that's any help

jrburke commented 12 years ago

Hmm, what you described should work -- it is what I explicitly designed for. However, I have not tried it extensively on Windows. What version of Windows and node are you using? I suggest node 0.8.x.

dangmai commented 12 years ago

I'm using Windows 7 x64, node 0.8.2 and volo 0.2.3, here's pretty much the exact steps that I took to reproduce this:

npm install -g volo
volo create fast
cd fast
npm install volo-appcache

Then I go into volofile and add

appcache: require('volo-appcache')({
    depends: ['build'],
    dir: 'www-built',
    htmlPath: 'index.html',
    manifestTemplate: ''
})

Afterwards

volo appcache

complains about Cannot find module 'volo-appcache'

But if I do

npm install volo
node node_modules/volo/bin/volo appcache

then everything works.

jrburke commented 12 years ago

This was a problem in the default project template for volo create -- it was using the "old format" for the volofile, which does not work with npm-installed local dependencies.

I updated the project template now and it works. Thanks for pointing out this problem!