node.js + express.js + dust.js issues
dust.js, express, node.js, templates
Solution
I once discussed about setting up Dust.js with `Express@3.0` on Node.js 0.6.x through the `consolidate.js` module. You can read it here
However, you may want to use LinkedIn's fork of Dust.js, which supports Node.js 0.6.x out of the box with other improvements.
`Consolidate.js` already supports that fork, but you still need `Express@3.0` to work.
Problem
The quick question: why won't express.js run with dust.js? I know it's not officially supported, but dust.js even has issues with my node.js version. Node won't even start due to require.path issues. ``` server:testapp treejanitor$ node --version v0.6.12 ``` I get issues when setting the app engine to dust. (app.js in express) ``` var dust = require('dust'); ... app.set('view engine', 'dust'); ``` I'm showing the console here to give you my simple list of modules. Also someone searching for the same problem might cut/paste the error. ``` server:hummr treejanitor$ npm list application-name@0.0.1 /Users/treejanitor/git/testapp/testapp ├── consolidate@0.3.0 extraneous ├── dust@0.3.0 ├─┬ express@2.5.8 │ ├─┬ connect@1.8.7 │ │ └── formidable@1.0.9 │ ├── mime@1.2.4 │ ├── mkdirp@0.3.0 │ └── qs@0.4.2 └─┬ jade@0.25.0 ├── commander@0.5.2 └── mkdirp@0.3.0 server:testapp treejanitor$ supervisor app.js DEBUG: Error: require.paths is removed. Use node_modules folders, or the NODE_PATH environment variable instead. at Function.<anonymous> (module.js:378:11) at Object.<anonymous> (/Users/treejanitor/git/testapp/testapp/node_modules/dust/lib/server.js:6:8) ``` I tried the following attempt with no luck: Dust.js load template from filesystem in Node.js NOTE: I tried the alpha version of express (3.0) which didn't help. Same goes for consolidate.js and all the modules in that example. Some reasons why I am interested in node + express + dust: LinkedIn picks dustjs Twitter's Bootstrap framework