pty.js
pty.js copied to clipboard
npm install error
$ npm install pty.js
> [email protected] install /Users/JimboSlice/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:810: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 /Users/JimboSlice/node_modules/pty.js
gyp ERR! node -v v0.10.30
gyp ERR! node-gyp -v v0.13.1
gyp ERR! not ok
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" "pty.js"
npm ERR! cwd /Users/JimboSlice
npm ERR! node -v v0.10.30
npm ERR! npm -v 1.4.21
npm ERR! code ELIFECYCLE
npm ERR!
npm ERR! Additional logging details can be found in:
npm ERR! /Users/JimboSlice/npm-debug.log
npm ERR! not ok code 0
Same here.
Seeing the same error on node 0.10.30, version 0.10.28 builds with no problems.
Seems to be caused by this: https://github.com/chjj/pty.js/blob/18238d37e2915b3ac97e4ae0d5cb3e33f76ac758/src/unix/pty.cc#L36
Related: https://github.com/chjj/pty.js/pull/78
+1 +1 +1
node v0.10.31
same issue + 1 in v0.10.28 Using nvm switch back to v0.10.27 then everything works.
Still not building with node 10.31
Found a workaround here and it works in v0.10.31 https://github.com/petethepig/devtools-terminal/issues/41#issuecomment-50264402
As @thejameskyle mentioned this build error seems to have been fixed in #78. The main issue now is that a v0.2.5 version hasn't been released yet.
To simplify what @akwangho had found, you can use npm to install from the git repo directly like this until v0.2.5 is released:
npm install git+https://github.com/chjj/pty.js.git
even simpler @KylePDavis
npm i chjj/pty.js --save
Thanks @samccone
@KylePDavis @samccone, neither of those work on my Mac:
$ npm install git+https://github.com/chjj/pty.js.git
npm http GET https://registry.npmjs.org/extend
npm http GET https://registry.npmjs.org/nan
npm http 304 https://registry.npmjs.org/extend
npm http 304 https://registry.npmjs.org/nan
|
> [email protected] install /project/node_modules/pty.js
> node-gyp rebuild
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>
^
1 error 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:810: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 /project/node_modules/pty.js
gyp ERR! node -v v0.10.31
gyp ERR! node-gyp -v v1.0.1
gyp ERR! not ok
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" "git+https://github.com/chjj/pty.js.git"
npm ERR! cwd /project
npm ERR! node -v v0.10.31
npm ERR! npm -v 1.4.25
npm ERR! code ELIFECYCLE
npm ERR!
npm ERR! Additional logging details can be found in:
npm ERR! /project/npm-debug.log
npm ERR! not ok code 0
Do you have a /usr/include/util.h
That is, I think you've perhaps not got Xcode and SDK installed if that doesn't exist.
I don't have /usr/include/util.h, but I have Xcode installed. What other SDKs do I need?
MacOS SDK, rather than just the IOS one?
Installing command line dev tools fixed it; is that another name for or a part of the MacOS SDK?
Will there ever be a binary distribution of pty.js made available for simpler installs and for building node-webkit apps without VMs or clusters.
Yeah, that installs the MacOS SDK.
Binary distributions are tough because it's a cross product between node versions and operating systems.
Could it be done with Travis-CI and AppVeyor?
Can v0.2.5 be released so we can use the npm registry again?
+1 looking forward to v0.2.5
+1
+1 node v0.10.32
+1 waiting for the fix
npm i chjj/pty.js --save
This is still the valid fix, until a new release is pushed
@samccone Thank for the fix :)
:+1:
@samccone Thank for the fix :) Works with node 0.10.35, osx
:+1:
I am getting this error:
pi@RaspberryIsc ~ $ npm install pty
[email protected] install /home/pi/node_modules/pty/node_modules/pty.js node-gyp rebuild
make: Entering directory '/home/pi/node_modules/pty/node_modules/pty.js/build'
CXX(target) Release/obj.target/pty/src/unix/pty.o
/usr/bin/g++: 1: /usr/bin/g++: Syntax error: "(" unexpected
pty.target.mk:82: recipe for target 'Release/obj.target/pty/src/unix/pty.o' failed
make: *** [Release/obj.target/pty/src/unix/pty.o] Error 2
make: Leaving directory '/home/pi/node_modules/pty/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:267:23)
gyp ERR! stack at ChildProcess.emit (events.js:98:17)
gyp ERR! stack at Process.ChildProcess._handle.onexit (child_process.js:820:12)
gyp ERR! System Linux 3.18.7-v7+
gyp ERR! command "node" "/usr/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild"
gyp ERR! cwd /home/pi/node_modules/pty/node_modules/pty.js
gyp ERR! node -v v0.10.37
gyp ERR! node-gyp -v v1.0.1
gyp ERR! not ok
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 Linux 3.18.7-v7+
npm ERR! command "/usr/bin/node" "/usr/bin/npm" "install" "pty"
npm ERR! cwd /home/pi
npm ERR! node -v v0.10.37
npm ERR! npm -v 1.4.28
npm ERR! code ELIFECYCLE
npm ERR! not ok code 0