petethepig / devtools-terminal

Terminal in Chrome Devtools
http://blog.dfilimonov.com/2013/09/12/devtools-terminal.html
MIT License
1.31k stars 88 forks source link

Cannot install because of PTY.js issue #41

Open andylouisqin opened 10 years ago

andylouisqin commented 10 years ago

Below is the error message I'm receiving when I try to run the command: "sudo npm install -g devtools-terminal":

npm ERR! Failed at the pty.js@0.2.4 install script. npm ERR! This is most likely a problem with the pty.js package, npm ERR! not with npm itself. npm ERR! Tell the author that this fails on your system: npm ERR! node-gyp rebuild npm ERR! You can get their info via: npm ERR! npm owner ls pty.js

00kenshin commented 10 years ago

Yea it seem pty is broken ....

stephenway commented 10 years ago

I can confirm this is happening on my Mac

realuserofgit commented 10 years ago

:+1:

maruf89 commented 10 years ago

Same setup, different error on my macbook pro using 10.9.4

npm install -g devtools-terminal                                                       12:42:42

> pty.js@0.2.4 install /usr/local/lib/node_modules/devtools-terminal/node_modules/pty.js
> node-gyp rebuild

  CXX(target) Release/obj.target/pty/src/unix/pty.o
../src/unix/pty.cc:487:10: error: use of undeclared identifier 'openpty'
  return openpty(amaster, aslave, name, (termios *)termp, (winsize *)winp);
         ^
../src/unix/pty.cc:533:10: error: use of undeclared identifier 'forkpty'
  return forkpty(amaster, name, (termios *)termp, (winsize *)winp);
         ^
2 errors generated.
make: *** [Release/obj.target/pty/src/unix/pty.o] Error 1
gyp ERR! build error
gyp ERR! stack Error: `make` failed with exit code: 2
gyp ERR! stack     at ChildProcess.onExit (/usr/local/lib/node_modules/npm/node_modules/node-gyp/lib/build.js:267:23)
gyp ERR! stack     at ChildProcess.emit (events.js:98:17)
gyp ERR! stack     at Process.ChildProcess._handle.onexit (child_process.js:809:12)
gyp ERR! System Darwin 13.3.0
gyp ERR! command "node" "/usr/local/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild"
gyp ERR! cwd /usr/local/lib/node_modules/devtools-terminal/node_modules/pty.js
gyp ERR! node -v v0.10.29
gyp ERR! node-gyp -v v0.13.1
gyp ERR! not ok

> ws@0.4.31 install /usr/local/lib/node_modules/devtools-terminal/node_modules/socket.io/node_modules/engine.io/node_modules/ws
> (node-gyp rebuild 2> builderror.log) || (exit 0)

npm ERR! pty.js@0.2.4 install: `node-gyp rebuild`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the pty.js@0.2.4 install script.
npm ERR! This is most likely a problem with the pty.js package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR!     node-gyp rebuild
npm ERR! You can get their info via:
npm ERR!     npm owner ls pty.js
npm ERR! There is likely additional logging output above.
npm ERR! System Darwin 13.3.0
npm ERR! command "node" "/usr/local/bin/npm" "install" "-g" "devtools-terminal"
npm ERR! cwd /Users/mac
npm ERR! node -v v0.10.29
npm ERR! npm -v 1.4.20
npm ERR! code ELIFECYCLE

> ws@0.4.31 install /usr/local/lib/node_modules/devtools-terminal/node_modules/socket.io/node_modules/socket.io-client/node_modules/engine.io-client/node_modules/ws
> (node-gyp rebuild 2> builderror.log) || (exit 0)
simonweil commented 10 years ago

I have the same error as @maruf89 and I do not manage to install this npm package. There is an open issue at pty.js: chjj/pty.js#62

Is there any work around for this?

simonweil commented 10 years ago

I found a workaround.

  1. mkdir /tmp/pty.js
  2. git clone https://github.com/chjj/pty.js.git /tmp/pty.js
  3. vi /tmp/pty.js/src/unix/pty.cc
  4. replace line 39: #include <util.h> with #include "/usr/include/util.h"
  5. npm install -g /tmp/pty.js
  6. and now npm install -g devtools-terminal should work.
DannyMoerkerke commented 10 years ago

Thanx simonweil, that works!

JaKXz commented 10 years ago

Thanks @simonweil!

stephenway commented 10 years ago

Thanks @simonweil

simonweil commented 10 years ago

You are welcome! You can up-vote my answer on stack overflow so other people experiencing this issue will find a solution too. http://stackoverflow.com/a/24981514/1574376

LukyVj commented 10 years ago

Wow ! Thanks @simonweil !

harrypujols commented 10 years ago

I have a new computer where the workaround breaks at npm install -g /tmp/tty.js it gives me this

  CXX(target) Release/obj.target/pty/src/unix/pty.o
../src/unix/pty.cc:37:10: fatal error: '/usr/include/util.h' file not found
#include </usr/include/util.h>

I checked if the command line tools were installed, and apparently you can't install them directly from Xcode anymore. I have to download it from a page at the Apple developer's site. I hope this is useful to someone who runs into this problems with a new computer.

By the way, I hope this problem is resolved and doesn't need a workaround.

adampfoster commented 9 years ago

Command Line Tools needs to be installed (Apple developer account required) https://developer.apple.com/downloads

tianyma commented 6 years ago

Thanks very much!

joeithub commented 4 years ago

make: Entering directory '/usr/lib/node_modules/devtools-terminal/node_modules/pty.js/build' CXX(target) Release/obj.target/pty/src/unix/pty.o make: g++: No such file or directory make: *** [pty.target.mk:107: Release/obj.target/pty/src/unix/pty.o] Error 127 make: Leaving directory '/usr/lib/node_modules/devtools-terminal/node_modules/pty.js/build' gyp ERR! build error gyp ERR! stack Error: make failed with exit code: 2 gyp ERR! stack at ChildProcess.onExit (/usr/lib/node_modules/npm/node_modules/node-gyp/lib/build.js:194:23) gyp ERR! stack at ChildProcess.emit (events.js:315:20) gyp ERR! stack at Process.ChildProcess._handle.onexit (internal/child_process.js:275:12) gyp ERR! System Linux 5.4.43-1-lts gyp ERR! command "/usr/bin/node" "/usr/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild" gyp ERR! cwd /usr/lib/node_modules/devtools-terminal/node_modules/pty.js gyp ERR! node -v v12.17.0 gyp ERR! node-gyp -v v5.1.0 gyp ERR! not ok npm ERR! code ELIFECYCLE npm ERR! errno 1 npm ERR! pty.js@0.3.1 install: node-gyp rebuild npm ERR! Exit status 1 npm ERR! npm ERR! Failed at the pty.js@0.3.1 install script. npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in: npm ERR! /root/.c9/tmp/.npm/_logs/2020-07-20T15_56_12_501Z-debug.log