I am trying to use passportjs with Mojito by doing the following:
1) after installing Node JS and Mojito
2) created a Mojito app
3) created a Mojito
4) included passport as a dependency in the package.json of the Mojito app
5) ran npm install (it fetched passport into the node_modules directory, which is in the app dir)
6) in the function for the init action of the controller (in controller.server.js of the mojit created in step 3), I am requiring the passport module (this.passport = require('passport')
), however Mojito complains with the following error:
/usr/local/lib/node_modules/mojito/node_modules/yui/yui-nodejs/yui-nodejs.js:1147
throw (e || new Error(msg));
^
Error: Cannot find module 'passport'
I've tried adding passport to the requires array that is passed to the YUI.add function in controller.server.js and according to the logs the mojito dispatcher is dispatching an instance of the my mojit/index with the passport module, however it also warns: [YUI-WARN] yui: NOT loaded: passport
Any ideas of what I might be doing wrong or any example of using any non-YUI nodejs module in Mojito?