I've googled this and read just about all the threads I come over here in the forum, but still I can't get this to work.
I'm trying to make dust.js work with node.js
test.js:
var dust = require('dust');
Running it:
$ node test
Error: require.paths is removed. Use node_modules folders, or the NODE_PATH environment variable instead.
at Function.Object.defineProperty.get (module.js:388:11)
at Object.<anonymous> (/usr/local/lib/node_modules/dust/lib/server.js:6:8)
at Module._compile (module.js:456:26)
at Object.Module._extensions..js (module.js:474:10)
at Module.load (module.js:356:32)
at Function.Module._load (module.js:312:12)
at Module.require (module.js:364:17)
at require (module.js:380:17)
at Object.<anonymous> (/usr/local/lib/node_modules/dust/lib/dust.js:511:7)
at Module._compile (module.js:456:26)
$ node -v
v0.10.5
I installed dust like it' supposed to be installed:
$ npm install -g dust
npm http GET https://registry.npmjs.org/dust
npm http 200 https://registry.npmjs.org/dust
npm http GET https://registry.npmjs.org/dust/-/dust-0.3.0.tgz
npm http 200 https://registry.npmjs.org/dust/-/dust-0.3.0.tgz
[email protected] /usr/local/lib/node_modules/dust
I've tried setting the NODE_PATH:
export NODE_PATH="/usr/local/lib/node_modules"
or
export NODE_PATH="/usr/local/lib/node"
Still nothing works..
The problem is that dust is not compatible with your node version. In the 0.6 version, node removed the require.paths method and dust repo is not being maintained anymore, so it just works with node 0.4.
Try the LinkedIn version wich has a lot of new features and is fully compatible with the new versions of node.
http://linkedin.github.io/dustjs/
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With