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

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

问题描述

[~]# node node.js

Error: Cannot find module 'socket.io'

[~]# node -v
v0.10.10

socket.io 已安装:

socket.io installed:

npm install socket.io

npm WARN package.json policyfile@0.0.4 No repository field.
npm WARN package.json policyfile@0.0.4 'repositories' (plural) Not supported.
npm WARN package.json Please pick one as the 'repository' field

推荐答案

看起来您已将 socket.io 安装在与当前路径不同的位置.要么像下面这样全局安装:

Looks like you have installed socket.io in a different location to your current path. Either install globally like below:

npm install -g socket.io

或参考您已安装到的位置:

Or reference the location you've installed to:

var io = require('../lib/socket.io');

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

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