错误:找不到模块"socket.io/node_modules/redis" [英] Error: Cannot find module 'socket.io/node_modules/redis'

查看:68
本文介绍了错误:找不到模块"socket.io/node_modules/redis"的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

只是从节点开始,我遇到了这个错误.我在Ubuntu 12.04上,并且按照

Just starting out with node and I'm getting this error. I am on Ubuntu 12.04 and I have globally installed nodejs, redis and socketio as instructed by http://maxburstein.com/blog/realtime-django-using-nodejs-and-socketio/

当我通过键入节点chat.js执行chat.js时,我得到

When I execute the chat.js by typing node chat.js I get

module.js:340
    throw err;
          ^
Error: Cannot find module 'socket.io/node_modules/redis'
    at Function.Module._resolveFilename (module.js:338:15)
    at Function.Module._load (module.js:280:25)
    at Module.require (module.js:364:17)
    at require (module.js:380:17)

请帮助.

谢谢

推荐答案

我认为这是因为您的Redis服务器未运行.在ubuntu控制台上键入 redis-cli 并查看是否连接到服务器.如果您未连接到服务器,请尝试以下命令,

I think this is because your Redis server isn't running.Type redis-cli on ubuntu console and see if you connect to the server. If you are not connected to the server try following command,

开始Redis,

sudo service redis-server start

这篇关于错误:找不到模块"socket.io/node_modules/redis"的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆