devtools-terminal icon indicating copy to clipboard operation
devtools-terminal copied to clipboard

Cannot install because of PTY.js issue

Open andylouisqin opened this issue 10 years ago • 15 comments

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 [email protected] 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

andylouisqin avatar Mar 26 '14 01:03 andylouisqin

Yea it seem pty is broken ....

00kenshin avatar May 20 '14 00:05 00kenshin

I can confirm this is happening on my Mac

stephenway avatar Jul 09 '14 15:07 stephenway

:+1:

realuserofgit avatar Jul 10 '14 05:07 realuserofgit

Same setup, different error on my macbook pro using 10.9.4

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

> [email protected] 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

> [email protected] 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! [email protected] install: `node-gyp rebuild`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the [email protected] 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

> [email protected] 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)

maruf89 avatar Jul 17 '14 16:07 maruf89

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 avatar Jul 27 '14 13:07 simonweil

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.

simonweil avatar Jul 27 '14 13:07 simonweil

Thanx simonweil, that works!

DannyMoerkerke avatar Jul 29 '14 08:07 DannyMoerkerke

Thanks @simonweil!

JaKXz avatar Aug 26 '14 20:08 JaKXz

Thanks @simonweil

stephenway avatar Aug 26 '14 22:08 stephenway

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

simonweil avatar Aug 27 '14 13:08 simonweil

Wow ! Thanks @simonweil !

LukyVj avatar Sep 10 '14 17:09 LukyVj

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.

harrypujols avatar Sep 28 '14 16:09 harrypujols

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

adampfoster avatar Nov 20 '14 23:11 adampfoster

Thanks very much!

tianyma avatar Nov 05 '17 13:11 tianyma

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! [email protected] install: node-gyp rebuild npm ERR! Exit status 1 npm ERR! npm ERR! Failed at the [email protected] 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

joeithub avatar Jul 20 '20 07:07 joeithub