Install Guide

36 views
Skip to first unread message

jakescott

unread,
Jul 24, 2010, 11:06:49 AM7/24/10
to Express
I followed the instructions by installing like this:
curl -# http://expressjs.com/install.sh | sh

I can use the $ express to generate a new app.

I can render the page but the css is returning a 500 internal server
error
Error: Cannot find module 'sass'
at module:249:21
at findModulePath (module:119:7)
at searchLocations (module:151:14)
at module:160:18
at path:79:19
at node.js:255:9

Would somebody be able to describe how to include other modules such
as sass.js and markdown-js. It would be good to know how to install by
cloning from Github and where we need to place these files.

Cheers
Jake

vision media [ Tj Holowaychuk ]

unread,
Jul 24, 2010, 12:59:01 PM7/24/10
to expre...@googlegroups.com
they just need to available to require(), so either:

   - npm install sass
   - clone the sass repo to ~/.node_libraries
   - submodule the library in your app and require.paths.unshift() the lib directory to expose it

I have had people suggest bundling these with express, but I dont 
want to bundle every potentially useful module with express so it
is a bit of a trade off. 


--
You received this message because you are subscribed to the Google Groups "Express" group.
To post to this group, send email to expre...@googlegroups.com.
To unsubscribe from this group, send email to express-js+...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/express-js?hl=en.




--
Tj Holowaychuk
Vision Media
President & Creative Lead

Jake Scott

unread,
Jul 25, 2010, 2:00:33 PM7/25/10
to expre...@googlegroups.com
Hi TJ thanks for the reply - Is there an example of some code of how to do this? - I'm only just learning node and express.

Jake Scott

unread,
Jul 25, 2010, 2:14:40 PM7/25/10
to expre...@googlegroups.com
Oh sorry dont worry about answering that one I just saw the blog example.

jakescott

unread,
Jul 27, 2010, 7:54:54 PM7/27/10
to Express
Has anyone got an example of a jade template and markdown working
together?
This is my app code


/**
* Module dependencies.
*/

var express = require('express'),
connect = require('connect'),
markdown = require('./lib/markdown-js/lib/markdown');

// Create and export Express app

var app = express.createServer();

// Configuration

app.configure(function(){
app.set('views', __dirname + '/views');
app.use(connect.bodyDecoder());
app.use(connect.methodOverride());
app.use(connect.compiler({ src: __dirname + '/public', enable:
['sass'] }));
app.use(connect.staticProvider(__dirname + '/public'));
});

app.configure('development', function(){
app.set('reload views', 1000);
app.use(connect.errorHandler({ dumpExceptions: true, showStack:
true }));
});

app.configure('production', function(){
app.use(connect.errorHandler());
});

// Routes

app.get('/', function(req, res){
res.render('index.jade', {
locals: {
title: 'Express'
}
});
});

app.listen(3000);

and my jade file is

h1= title
p Welcome to #{title}

:markdown
| Woah! Jade _and_ markdown, very **cool**


form
label(for='email') Email
div.form_part
p
input(type='email', id='email', name='email')

label(for='password') Password
div.form_part
p
input(type='password', id='password', name='password')


but I get the error


Connect
500 Error: /Users/jakescott/express/forms/views/index.jade:8 6. '' 7.
'' 8. 'form' Cannot find module 'markdown'

* 6. ''
* 7. ''
* 8. 'form'
*
* Cannot find module 'markdown'
* at loadModule (module:238:15)
* at require (module:364:12)
* at /Users/jakescott/.node_libraries/jade.js:116:18
* at Object.parseFilter (/Users/jakescott/.node_libraries/jade.js:
444:35)
* at Object.parseExpr (/Users/jakescott/.node_libraries/jade.js:
393:29)
* at Object.parseExpr (/Users/jakescott/.node_libraries/jade.js:
421:38)
* at Object.parseExpr (/Users/jakescott/.node_libraries/jade.js:
421:38)
* at Object.parse (/Users/jakescott/.node_libraries/jade.js:
353:27)
* at parse (/Users/jakescott/.node_libraries/jade.js:729:29)
* at Object.render (/Users/jakescott/.node_libraries/jade.js:
771:14)






On Jul 25, 7:14 pm, Jake Scott <jake....@gmail.com> wrote:
> Oh sorry dont worry about answering that one I just saw the blog example.
>
> On Sun, Jul 25, 2010 at 7:00 PM, Jake Scott <jake....@gmail.com> wrote:
> > Hi TJ thanks for the reply - Is there an example of some code of how to do
> > this? - I'm only just learning node and express.
>
> > On Sat, Jul 24, 2010 at 5:59 PM, vision media [ Tj Holowaychuk ] <
> > t...@vision-media.ca> wrote:
>
> >> they just need to available to require(), so either:
>
> >>    - npm install sass
> >>    - clone the sass repo to ~/.node_libraries
> >>    - submodule the library in your app and require.paths.unshift() the lib
> >> directory to expose it
>
> >> I have had people suggest bundling these with express, but I dont
> >> want to bundle every potentially useful module with express so it
> >> is a bit of a trade off.
>
> >> On Sat, Jul 24, 2010 at 8:06 AM, jakescott <jake....@gmail.com> wrote:
>
> >>> I followed the instructions by installing like this:
> >>> curl -#http://expressjs.com/install.sh| sh
>
> >>> I can use the $ express to generate a new app.
>
> >>> I can render the page but the css is returning a 500 internal server
> >>> error
> >>> Error: Cannot find module 'sass'
> >>>    at module:249:21
> >>>    at findModulePath (module:119:7)
> >>>    at searchLocations (module:151:14)
> >>>    at module:160:18
> >>>    at path:79:19
> >>>    at node.js:255:9
>
> >>> Would somebody be able to describe how to include other modules such
> >>> as sass.js and markdown-js. It would be good to know how to install by
> >>> cloning from Github and where we need to place these files.
>
> >>> Cheers
> >>> Jake
>
> >>> --
> >>> You received this message because you are subscribed to the Google Groups
> >>> "Express" group.
> >>> To post to this group, send email to expre...@googlegroups.com.
> >>> To unsubscribe from this group, send email to
> >>> express-js+...@googlegroups.com<express-js%2Bunsu...@googlegroups.com>
> >>> .
> >>> For more options, visit this group at
> >>>http://groups.google.com/group/express-js?hl=en.
>
> >> --
> >> Tj Holowaychuk
> >> Vision Media
> >> President & Creative Lead
>
> >> --
> >> You received this message because you are subscribed to the Google Groups
> >> "Express" group.
> >> To post to this group, send email to expre...@googlegroups.com.
> >> To unsubscribe from this group, send email to
> >> express-js+...@googlegroups.com<express-js%2Bunsu...@googlegroups.com>
> >> .

vision media [ Tj Holowaychuk ]

unread,
Jul 27, 2010, 9:42:33 PM7/27/10
to expre...@googlegroups.com
You need either node-discount (npm install markdown) or markdown-js 
installed

To unsubscribe from this group, send email to express-js+...@googlegroups.com.

For more options, visit this group at http://groups.google.com/group/express-js?hl=en.

Jake Scott

unread,
Jul 28, 2010, 4:15:29 AM7/28/10
to expre...@googlegroups.com
Yeah I have tried (npm install markdown) maybe there is something wierd happening on my system. Will do some more investigating tonight.

Sorry to be a pain
Jake

vision media [ Tj Holowaychuk ]

unread,
Jul 28, 2010, 10:19:41 AM7/28/10
to expre...@googlegroups.com
for node-discount (markdown on npm) you need discount installed too, it is just bundings.
deps suck :D
Reply all
Reply to author
Forward
0 new messages