Skip to content
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

sudo devtools-terminal --install gives error #81

Open
bsr203 opened this issue Nov 18, 2016 · 3 comments
Open

sudo devtools-terminal --install gives error #81

bsr203 opened this issue Nov 18, 2016 · 3 comments

Comments

@bsr203
Copy link

bsr203 commented Nov 18, 2016

sudo devtools-terminal --install                                                                                                                           ⏎ master ✱
/usr/local/lib/node_modules/devtools-terminal/node_modules/socket.io/lib/store.js:35
Store.prototype.__proto__ = EventEmitter.prototype;
                                        ^

TypeError: Cannot read property 'prototype' of undefined
    at Object.<anonymous> (/usr/local/lib/node_modules/devtools-terminal/node_modules/socket.io/lib/store.js:35:41)
    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.<anonymous> (/usr/local/lib/node_modules/devtools-terminal/node_modules/socket.io/lib/manager.js:16:13)
    at Module._compile (module.js:573:32)

node --version master ✱
v7.0.0

OS X 10.9.5

npm install -g devtools-terminal ⏎ master ✱
/usr/local/bin/devtools-terminal -> /usr/local/lib/node_modules/devtools-terminal/bin/devtools-terminal
/usr/local/lib
└── [email protected]

Edit:

from this , it could be an issue with dependencies with node v7.

@jchv
Copy link

jchv commented Dec 14, 2016

It seems Node v7 finally removes process.EventEmitter. Practically speaking this means that Socket.IO 0.9.x no longer works. The correct solution, at least in my mind, would be to upgrade Socket.IO or probably just use WebSockets, though I am new to this codebase and am not 100% certain why Socket.IO 0.9 is here.

If you just want a workaround, you can manually patch the local Socket.IO installation. Go to the node_modules/socket.io for devtools-terminal, i.e. /usr/lib/node_modules/devtools-terminal/node_modules/socket.io/ and replace process.EventEmitter with require('events') globally.

Example:

sudo find . -type f -name '*.js' -exec sed -i "s/process.EventEmitter/require('events')/g" 
{} +

Perhaps a middleground between those two would be a fork of Socket.IO 0.9.x (does such possibly already exist?) or trying to convince the maintainers of Socket.IO to release a new 0.9.x build with this fixed.

(Also, still having trouble in Linux - the blank terminal bug. Oh well... It can be worked around using the solution linked to at the top of the README.)

(P.S.: Use the --chromium option if you are installing for Chromium browser.)

@ubermensh
Copy link

for mac users, if they have sed error for the command suggested above:
sudo find . -type f -name '*.js' -exec sed -i '' -e "s/process.EventEmitter/require('events')/g" {} +
https://stackoverflow.com/questions/19456518/invalid-command-code-despite-escaping-periods-using-sed

@sandhani
Copy link

sandhani commented Feb 26, 2018

In case if you face any error "sed: RE error: illegal byte sequence"
export and then run above same command.

export LC_CTYPE=C
export LANG=C

It worked for me.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants