node is crashing at the following line:

节点在以下行崩溃:

var tcp = require('tcp'),

error text:

错误文字:

node.js:201
    throw e; // process.nextTick error, or 'error' event on first tick
          ^
Error: Cannot find module 'tcp'
at Function._resolveFilename (module.js:334:11)
at Function._load (module.js:279:25)
at Module.require (module.js:357:17)
at require (module.js:368:17)
at Object.<anonymous> (C:\Program Files\nodejs\websocket\websocket.js:11:11)

at Module._compile (module.js:432:26)
at Object..js (module.js:450:10)
at Module.load (module.js:351:31)
at Function._load (module.js:310:12)
at Module.require (module.js:357:17)

What is the problem? I found the source on the Internet, and the author, and the visitors also can run it...

问题是什么?我在互联网上找到了源代码,作者和访问者也可以运行它...

2 个解决方案

#1


12

Try require('net') instead:

请尝试require('net'):

$ node
> var tcp = require('tcp');
The 'tcp' module is now called 'net'. Otherwise it should have a similar interface.
> var tcp = require('net');
> $ 

更多相关文章

  1. 读取python中的unicode文件,该文件以与python源代码相同的方式声
  2. 迭代地在python中编写XML节点
  3. django npm和节点包体系结构
  4. 软交换FreeSWITCH系统概要和源代码分析预备知识
  5. Linux内核源代码情景分析读书笔记(5)-关于fork/clone/vfork
  6. Linux下各类TCP网络服务器的实现源代码
  7. U-Boot启动过程源代码分析(2)-第二阶段
  8. 如何查看linux命令源代码和函数源代码
  9. UNIX网络编程之源代码的编译和使用

随机推荐

  1. Unity3d和iOS、Android的混合开发介绍
  2. android 安卓事件处理示例
  3. 第3.2.1节 android基本视图
  4. android 自定义图片剪裁
  5. TextView跑马灯
  6. (Android) Download Images by AsyncTask
  7. android customactivityoncrashchau 程序
  8. android   CheckBox 用法
  9. android照相及照片上传
  10. Android第五期 - 更新自己的apk本地与网