-
Notifications
You must be signed in to change notification settings - Fork 481
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
TypeError: Cannot read property 'prototype' of undefined #168
Comments
It would be better if you upgrade to the newest socket.io. |
Seems this repo is not maintained any more. I'll focus on my own fork. https://github.com/blackmiaool/tty.js |
+1 |
Any solutions on that? Also the clone of blackmaool still has the same problem. Looking forward for a fix. |
BTW: Which version do I get by "npm install tty"? This one or the clone from backmiaool? Maybe it makes sense to rename the clone to e.g. tty2 and publish it under that new name in the npm registry? |
@LosWochos76 I tried to install my fork again on my linux and found it worked well. Could you check your installation of my fork? |
@qeesung @LosWochos76 This problem is caused by deprecation of old style event emitter in node7. The emitter is used by the old edition of socket.io. The solution to the problem is copying the socket.io module to root directory of this module, updating the event emitter style of it, and referring it in this module. Or you can migrate the socket.io in this module to new edition. |
Sorry, but the fork does not work. Installing it with git clone https://github.com/blackmiaool/tty.js I face multiple problems:
tty.js/tty.js/socket.io/lib/static.js:100 TypeError: client.builder is not a function |
@LosWochos76 Sorry. I found the problem. You can fix it by entering socket.io directory and execute "npm install" or pulling the newest repo. |
@chjj hi I am using the term.js The is the plug-in to complex paste? |
https://github.com/risacher/ttyx is a fork that replaces term.js with xterm.js, updates socket.io to version 1.x and updates Express to version 4.x. Hope this helps. |
god ! this have to many error, how to deal with it? TypeError: Cannot read property 'prototype' of undefined |
@risacher TypeError: express.basicAuth is not a function |
I am facing this issue when i run command E:\xampp\htdocs\ng-demos\modular\node_modules\karma\node_modules\socket.io\lib\store.js:35 TypeError: Cannot read property 'prototype' of undefined |
Looks like you need to upgrade your socket.io version. Older versions use |
@hassanuos If you update socket.io to latest version you have to modify also the code (in tty.js remove io.configure(..)). |
Well, i tried many solutions from all the above options. i found the real problem to be node version. Also wanted to mention, i did not have issue specific to tty.js, solution
started the app again, and it was working. |
good |
/.nvm/versions/node/v7.1.0/lib/node_modules/tty.js/node_modules/socket.io/lib/transports/websocket/hybi-07-12.js:449
Parser.prototype.proto = EventEmitter.prototype;
^
TypeError: Cannot read property 'prototype' of undefined
at Object. (/home/blackmiaool/.nvm/versions/node/v7.1.0/lib/node_modules/tty.js/node_modules/socket.io/lib/transports/websocket/hybi-07-12.js:449:42)
at Module._compile (module.js:573:32)
at Object.Module._extensions..js (module.js:582:10)
at Module.load (module.js:490:32)
at tryModuleLoad (module.js:449:12)
at Function.Module._load (module.js:441:3)
at Module.require (module.js:500:17)
at require (internal/module.js:20:19)
at Object. (/home/blackmiaool/.nvm/versions/node/v7.1.0/lib/node_modules/tty.js/node_modules/socket.io/lib/transports/websocket/index.js:7:6)
at Module._compile (module.js:573:32)
Solution:
1 Enter ~/.nvm/versions/node/v7.1.0/lib/node_modules/tty.js/node_modules/socket.io/lib/ (change v7.1.0 to your node edition or redirect it to your node folder it you don't use nvm)
2 Replace "EventEmitter = process.EventEmitter" with "EventEmitter = require('events')"
3 Save and retry.
The text was updated successfully, but these errors were encountered: