node.js安装 - 找不到快递

Ale*_*nko 1 node.js

我安装表达它在express.js指南中显示的方式. http://expressjs.com/guide.html

运行'node app'后,我收到此错误:

   /Users/xxx/Documents/work/node/app.js:3
    var app = express();
              ^
    ReferenceError: express is not defined
        at Object.<anonymous> (/Users/xxx/Documents/work/node/app.js:3:11)
        at Module._compile (module.js:449:26)
        at Object.Module._extensions..js (module.js:467:10)
        at Module.load (module.js:356:32)
        at Function.Module._load (module.js:312:12)
        at Module.runMain (module.js:492:10)
        at process.startup.processNextTick.process._tickCallback (node.js:244:9)
    nma:node xxx$ 
Run Code Online (Sandbox Code Playgroud)

ebo*_*man 8

你需要这样的东西var express=require('express');,以便express进行定义.你引用的链接提到了这样做; 也许你掩饰了一两步(比你想象的要容易得多)?