app.use(express.static(path.join(__dirname, 'public'))); ReferenceError: path is not defined what is problem?

5,973 views
Skip to first unread message

Tae-Hwa Lee

unread,
Dec 17, 2013, 6:32:52 AM12/17/13
to expre...@googlegroups.com
Console Error Message "app.use(express.static(path.join(__dirname, 'public')));  ReferenceError: path is not defined"

Im installed express 3.3.5 version

What is problem?

Jason Crawford

unread,
Dec 18, 2013, 1:01:35 PM12/18/13
to expre...@googlegroups.com
You need to explicitly import the path module:

var path = require('path');

-Jason


--
You received this message because you are subscribed to the Google Groups "Express" group.
To unsubscribe from this group and stop receiving emails from it, send an email to express-js+...@googlegroups.com.
To post to this group, send email to expre...@googlegroups.com.
Visit this group at http://groups.google.com/group/express-js.
For more options, visit https://groups.google.com/groups/opt_out.

Reply all
Reply to author
Forward
0 new messages