pty.js icon indicating copy to clipboard operation
pty.js copied to clipboard

npm install error

Open jamestillercode opened this issue 11 years ago • 27 comments

$ 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

jamestillercode avatar Aug 14 '14 22:08 jamestillercode

Same here.

dahal avatar Aug 15 '14 05:08 dahal

Seeing the same error on node 0.10.30, version 0.10.28 builds with no problems.

shackpank avatar Aug 18 '14 10:08 shackpank

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

jamiebuilds avatar Aug 30 '14 18:08 jamiebuilds

+1 +1 +1

node v0.10.31

samccone avatar Sep 03 '14 02:09 samccone

same issue + 1 in v0.10.28 Using nvm switch back to v0.10.27 then everything works.

akwangho avatar Sep 23 '14 10:09 akwangho

Still not building with node 10.31

bitspook avatar Sep 23 '14 12:09 bitspook

Found a workaround here and it works in v0.10.31 https://github.com/petethepig/devtools-terminal/issues/41#issuecomment-50264402

akwangho avatar Sep 24 '14 09:09 akwangho

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

KylePDavis avatar Sep 26 '14 03:09 KylePDavis

even simpler @KylePDavis

npm i chjj/pty.js --save

samccone avatar Sep 26 '14 03:09 samccone

Thanks @samccone

jpillora avatar Oct 02 '14 10:10 jpillora

@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

stevenvachon avatar Oct 04 '14 21:10 stevenvachon

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.

aredridel avatar Oct 05 '14 03:10 aredridel

I don't have /usr/include/util.h, but I have Xcode installed. What other SDKs do I need?

stevenvachon avatar Oct 05 '14 05:10 stevenvachon

MacOS SDK, rather than just the IOS one?

aredridel avatar Oct 05 '14 05:10 aredridel

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.

stevenvachon avatar Oct 05 '14 17:10 stevenvachon

Yeah, that installs the MacOS SDK.

aredridel avatar Oct 05 '14 17:10 aredridel

Binary distributions are tough because it's a cross product between node versions and operating systems.

aredridel avatar Oct 05 '14 17:10 aredridel

Could it be done with Travis-CI and AppVeyor?

stevenvachon avatar Oct 05 '14 17:10 stevenvachon

Can v0.2.5 be released so we can use the npm registry again?

chrissexton avatar Oct 07 '14 17:10 chrissexton

+1 looking forward to v0.2.5

tonyennis avatar Oct 09 '14 15:10 tonyennis

+1

srathbun avatar Oct 16 '14 17:10 srathbun

+1 node v0.10.32

cades avatar Nov 23 '14 10:11 cades

+1 waiting for the fix

MunGell avatar Nov 26 '14 21:11 MunGell

npm i chjj/pty.js --save

This is still the valid fix, until a new release is pushed

samccone avatar Nov 26 '14 21:11 samccone

@samccone Thank for the fix :)

:+1:

apendua avatar Dec 20 '14 20:12 apendua

@samccone Thank for the fix :) Works with node 0.10.35, osx

:+1:

nooitaf avatar Jan 17 '15 15:01 nooitaf

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

isc30 avatar Mar 17 '15 17:03 isc30