How to 'include' a Node.js module?


#1

Hello,

I really dont understand why this must be so difficult?

I installed this package;

https://www.npmjs.com/package/woocommerce

its directory is under ROOT/node_modules/woocommerce

But when I put var WooCommerce = require(‘woocommerce’); in my app.js;

Error: Module name “woocommerce” has not been loaded yet for context: _. Use require([])
http://requirejs.org/docs/errors.html#notloaded

I cannot find any docs howto include a Node.js module…