我正在尝试在Node中使用Express,安装一切顺利,编译成功,并使用以下命令通过npm安装了express:
npm install express
问题是,每次我尝试“require”它时,都会出现错误!看一下这个简单的app.js文件:
var express = require('express');
当我运行它时:
tlab065:~/proj/Express-server-abstraction> node app.js
node.js:116
throw e; // process.nextTick error, or 'error' event on first tick
^
TypeError: Cannot read property 'prototype' of undefined
at Object.<anonymous> (/people/home/jdomingues/local/node/lib/node/.npm/express/1.0.7/package/lib/express/server.js:87:44)
at Module._compile (module.js:373:26)
at Object..js (module.js:379:10)
at Module.load (module.js:305:31)
at Function._load (module.js:271:10)
at require (module.js:317:19)
at Object.<anonymous> (/people/home/jdomingues/local/node/lib/node/.npm/express/1.0.7/package/lib/express/index.js:28:31)
at Module._compile (module.js:373:26)
at Object..js (module.js:379:10)
at Module.load (module.js:305:31
有人可以帮我吗?为什么会出现这个错误?我怎样才能安装不同版本的express库?