I don't know if this is a bug or a feature:
- I had an app without a node-main file. The html files used require without problem, e.g. require('jade') or require('nano').
- I added a node-main file to this app, and now it says "Cannot find module 'jade'" or "'nano'".
I found a way around by requiring the module in the node-main file and passing it to the HTML files through global:
node-main:
global.jade = require('jade');
index.html:
var jade = global.jade; // require('jade') does not work when there is a node-main is package.json
Why is it that adding a node-main file changes the way require works in the HTML file?
I would also rather require the module where I need them, rather than having to load them all in the node-main file.
Thanks,
michel
PS: issue is the same with node 0.3.7 and 0.4.0