devtools-terminal
devtools-terminal copied to clipboard
Cannot install because of PTY.js issue
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
Yea it seem pty is broken ....
I can confirm this is happening on my Mac
:+1:
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)
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?
I found a workaround.
-
mkdir /tmp/pty.js
-
git clone https://github.com/chjj/pty.js.git /tmp/pty.js
-
vi /tmp/pty.js/src/unix/pty.cc
- replace line 39:
#include <util.h>
with#include "/usr/include/util.h"
-
npm install -g /tmp/pty.js
- and now
npm install -g devtools-terminal
should work.
Thanx simonweil, that works!
Thanks @simonweil!
Thanks @simonweil
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
Wow ! Thanks @simonweil !
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.
Command Line Tools needs to be installed (Apple developer account required) https://developer.apple.com/downloads
Thanks very much!
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