Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Installing dust.js for node.js (Error: require.paths is removed...)

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..

like image 345
Fractalf Avatar asked Mar 24 '23 02:03

Fractalf


1 Answers

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/

like image 172
JAiro Avatar answered Apr 06 '23 09:04

JAiro