我的计算机(mac)上安装了node,mongodb和redis,并尝试使用以下说明测试此应用https://github.com/vinkaga/node-backbone
Install and run MongoDB
Install and run Redis.io
Edit config.js if you are running MongoDB or Redis.io from another machine or non-default port
Start server by typing "node server.js"
之前从未使用过node或express并天真地假设运行node server.js
足以让一切都开始,我做到了,但它说
![Error: Cannot find module 'express'][1]
这是应用程序的目录
这是package.json文件。为了让它在本地机器上运行,我还需要做些什么吗?
{
"name":"YOUR-PROJECT-NAME",
"description":"YOUR PROJECT DESCRIPTION",
"author":"YOUR NAME <your@emailaddress.com>",
"version":"0.0.1",
"dependencies":{
"connect":">=2.1.2",
"express":"2.x.x",
"connect-redis" : ">=1.3.0",
"jade":">=0.24.0",
"ejs" : ">=0.7.1",
"mongoose":">=2.5.14",
"socket.io":">=0.9.5",
"connect-assetmanager":">=0.0.27",
"connect-assetmanager-handlers" : ">=0.0.18"
},
"devDependencies":{
"vows":">=0.6.2",
"mocha":">=1.0.1",
"should":">=0.6.1",
"request":">=2.9.x",
"soda":">=0.2.5"
},
"engine":"node >= 0.6.12"
}
答案 0 :(得分:4)
从项目目录
运行此命令$ npm install