SitePoint Sponsor

User Tag List

Results 1 to 2 of 2
  1. #1
    SitePoint Member
    Join Date
    Feb 2013
    Posts
    19
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Chapter 3: Page 61: server wont start - ReferenceError: _dirname is not defined

    Title says it all. Any ideas?

    Code:
    D:\JumpStartNodeJs\nockmarket\nockmarket.js:42
      app.set('views', _dirname + '/views');
                       ^
    ReferenceError: _dirname is not defined
        at HTTPServer.app.set.layout (D:\JumpStartNodeJs\nockmarket\nockmarket.js:42
    :20)
        at HTTPServer.app.configure (D:\JumpStartNodeJs\nockmarket\node_modules\expr
    ess\lib\http.js:542:61)
        at Object.<anonymous> (D:\JumpStartNodeJs\nockmarket\nockmarket.js:41:5)
        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 Function.Module.runMain (module.js:497:10)
        at startup (node.js:119:16)
        at node.js:901:3
    
    D:\JumpStartNodeJs\nockmarket>

  2. #2
    SitePoint Member
    Join Date
    Feb 2013
    Posts
    19
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Turns out I was missing an extra underscore: __dirname.

    http://stackoverflow.com/questions/1...me-not-defined


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •