第一次尝试使用 Amazon EC2 安装 node.js 服务器。按照这篇文章做。安装 node.js,然后是 npm,然后是所有其他模块。都没有错误。但是由于某种原因,我的服务器没有启动。你能告诉我在哪里找到错误吗?
[ec2-user@domU-12-31-39-07-62-87 ~]$ node server.js
module.js:340
throw err;
^
Error: Cannot find module 'socket.io'
at Function.Module._resolveFilename (module.js:338:15)
at Function.Module._load (module.js:280:25)
at Module.require (module.js:362:17)
at require (module.js:378:17)
at Object.<anonymous> (/home/ec2-user/server.js:3:10)
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)
[ec2-user@domU-12-31-39-07-62-87 ~]$ cd node
[ec2-user@domU-12-31-39-07-62-87 node]$ node server.js
module.js:340
throw err;
^
Error: Cannot find module '/home/ec2-user/node/server.js'
at Function.Module._resolveFilename (module.js:338:15)
at Function.Module._load (module.js:280:25)
at Module.runMain (module.js:492:10)
at process.startup.processNextTick.process._tickCallback (node.js:244:9)