hapijs / glue

Server composer for hapi.js
Other
245 stars 62 forks source link

Directory scope is wrong when using rejoice from different folder. #21

Closed asaf closed 9 years ago

asaf commented 9 years ago

Hey,

(I hope this issue is related to glue and not rejoice) When installing rejoice globally, all glue plugin 'require' statements fail with such:

module.js:338
    throw err;
          ^
Error: Cannot find module 'good'
    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.internals.parsePlugin (/Users/me/apps/node-v0.12.2-darwin-x64/lib/node_modules/rejoice/node_modules/glue/lib/index.js:218:23)

As it seems, the 'require' statement fails since the current directory is where rejoice was installed globally instead of the current one.

rejoice with -p also doesn't fix the problem.

Thanks.

csrl commented 9 years ago

You'll need to make your plugin keys a relative path. Instead of

"plugins": {
  "good": {...}
}

use

"plugins":{
  "./good": {...}
}

and provide the path to the node_modules folder that contains the plugins using rejoice's -p arg.

asaf commented 9 years ago

Uh missed the -p arg, thanks!

lock[bot] commented 4 years ago

This thread has been automatically locked due to inactivity. Please open a new issue for related bugs or questions following the new issue template instructions.