我想在ubuntu服務器中部署我的節點+ express js應用程序。但是,在我的項目文件夾執行NPM開始,我得到:無法在ubuntu中啓動節點服務器
> [email protected] start /data/node/organization-social-network/organizationconnect
> node ./bin/www
node.js:201
throw e; // process.nextTick error, or 'error' event on first tick
^
Error: Cannot find module 'domain'
at Function._resolveFilename (module.js:332:11)
at Function._load (module.js:279:25)
at Module.require (module.js:354:17)
at require (module.js:370:17)
at Object.nodeRequire (/data/node/node_modules/nodemailer/node_modules/aws- sdk/lib/util.js:39:31)
at Object.<anonymous> (/data/node/node_modules/nodemailer/node_modules/aws-sdk/lib/sequential_executor.js:2:23)
at Module._compile (module.js:441:26)
at Object..js (module.js:459:10)
at Module.load (module.js:348:32)
at Function._load (module.js:308:12)
npm ERR! [email protected] start: `node ./bin/www`
npm ERR! `sh "-c" "node ./bin/www"` failed with 1
npm ERR!
npm ERR! Failed at the [email protected] start script.
npm ERR! This is most likely a problem with the project1 package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR! node ./bin/www
npm ERR! You can get their info via:
npm ERR! npm owner ls project1
npm ERR! There is likely additional logging output above.
npm ERR!
npm ERR! System Linux 3.2.0-25-virtual
npm ERR! command "node" "/usr/bin/npm" "start"
npm ERR! cwd /data/node/organization-social-network/organizationconnect
npm ERR! node -v v0.6.12
npm ERR! npm -v 1.1.4
npm ERR! code ELIFECYCLE
npm ERR! message [email protected] start: `node ./bin/www`
npm ERR! message `sh "-c" "node ./bin/www"` failed with 1
npm ERR! errno {}
npm ERR!
npm ERR! Additional logging details can be found in:
npm ERR! /data/node/organization-social-network/organizationconnect/npm-debug.log
npm not ok
現在,我不會在我的本地機器使用域模塊明確地(nodemailer是雖然使用)。即使那時我安裝了域模塊,但錯誤仍然存在。請幫我出
編輯1:
我的包JSON文件:
{
"name": "project1",
"version": "0.0.1",
"private": true,
"scripts": {
"start": "node ./bin/www"
},
"dependencies": {
"express": "~4.2.0",
"static-favicon": "~1.0.0",
"morgan": "~1.0.0",
"cookie-parser": "~1.0.1",
"body-parser": "~1.0.0",
"debug": "~0.7.4",
"jade": "~1.3.0",
"socket.io": "*",
"express-sessions":"latest",
"session-middleware":"latest"
}
}
轉到package.json,檢查應用程序的入口點。檢查該文件是否存在 – mithunsatheesh 2014-09-23 09:11:02
我已經使用package.json更新了我的文章。請注意,相同的代碼在我的本地機器運行相同的文件夾結構 – user746458 2014-09-23 10:04:52