简体   繁体   English

Karma无法读取未定义的socket.io的属性'prototype'?

[英]Karma Cannot read property 'prototype' of undefined socket.io?

Hi just trying to do a basic karma setup 嗨,只是想做一个基本的业力设置

Have followed here 跟着来了

but whenever I try to run ./node_modules/karma/bin/karma start 但每当我试图运行./node_modules/karma/bin/karma start

I get: 我明白了:

My-iMac:karma myname$ ./node_modules/karma/bin/karma start

/Applications/MAMP/htdocs/_Tutorials/AngularApps/_webpack/karma/node_modules/socket.io/lib/store.js:35
Store.prototype.__proto__ = EventEmitter.prototype;
                                         ^

TypeError: Cannot read property 'prototype' of undefined
    at Object.<anonymous> (/Applications/MAMP/htdocs/_Tutorials/AngularApps/_webpack/karma/node_modules/socket.io/lib/store.js:35:42)
    at Module._compile (module.js:635:30)
    at Object.Module._extensions..js (module.js:646:10)
    at Module.load (module.js:554:32)
    at tryModuleLoad (module.js:497:12)
    at Function.Module._load (module.js:489:3)
    at Module.require (module.js:579:17)
    at require (internal/module.js:11:18)
    at Object.<anonymous> (/Applications/AngularApps/_webpack/karma/node_modules/socket.io/lib/manager.js:16:13)
    at Module._compile (module.js:635:30)

Wondering why it's even looking for socket.io?? 想知道为什么它甚至在寻找socket.io ??

my package json: 我的包json:

  "name": "karma-seed",
  "version": "1.0.0",
  "description": "",
  "scripts": {
    "test": "./node_modules/karma/bin/karma start karma.conf.js"
  },
  "devDependencies": {
    "jasmine-core": "^2.2.0",
    "karma": "^0.12.31",
    "karma-chrome-launcher": "^0.1.7",
    "karma-jasmine": "^0.3.5"
  }
}

Node version: v8.9.1 节点版本:v8.9.1

Npm : 5.6.0 Npm:5.6.0

I've installed karma-cli globally 我在全球安装了karma-cli

Update the karma version to package.json - "karma": "^2.0.0" 将业力版本更新为package.json - “karma”:“^ 2.0.0”

or simply run npm install karma --save-dev 或者只是运行npm install karma --save-dev

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 Socket.io:“无法读取未定义的属性&#39;emit&#39;” - Socket.io : “Cannot read property 'emit' of undefined” Node.js和Socket.io-无法读取未定义的属性“ on” - Node.js & Socket.io - Cannot read property 'on' of undefined Socket.IO TypeError:无法读取未定义的属性“发出” - Socket.IO TypeError: Cannot read property 'emit' of undefined Socket.io引发“ TypeError:无法读取未定义的属性&#39;push&#39;” - Socket.io raises “TypeError: Cannot read property 'push' of undefined” AngularJS Socket.io:无法读取未定义的属性“ emit” - AngularJS Socket.io: Cannot read property 'emit' of undefined Socket.io 未捕获类型错误:无法读取未定义的属性“应用” - Socket.io Uncaught TypeError: Cannot read property 'apply' of undefined Socket.io TypeError:无法读取未定义的属性“hteam” - Socket.io TypeError: Cannot read property 'hteam' of undefined Socket.io - UnhandledPromiseRejectionWarning: TypeError: Cannot read property 'emit' of undefined - Socket.io - UnhandledPromiseRejectionWarning: TypeError: Cannot read property 'emit' of undefined 业力:TypeError:无法读取未定义的属性“ prototype” - karma: TypeError: Cannot read property 'prototype' of undefined WebRTC,socket.io,node.js:无法读取未定义的属性&#39;emit&#39;? - WebRTC , socket.io, node.js: Cannot read property 'emit' of undefined?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM