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

Can't install in mac osx

Open bagusflyer opened this issue 11 years ago • 21 comments

I got errors when I ran the command:

sudo npm install -g tty.js

The error messages are:

[email protected] install /usr/local/lib/node_modules/tty.js/node_modules/pty.js node-gyp rebuild

shell-init: error retrieving current directory: getcwd: cannot access parent directories: Permission denied sh: node-gyp: command not found npm ERR! [email protected] install: node-gyp rebuild npm ERR! Exit status 127 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.

bagusflyer avatar Apr 18 '14 14:04 bagusflyer

I installed the node-gyp by:

sudo npm install -g node-gyp

But can't solve the problem.

bagusflyer avatar Apr 18 '14 14:04 bagusflyer

Any idea?

bagusflyer avatar Apr 20 '14 13:04 bagusflyer

Anybody encounter the same issue?

bagusflyer avatar May 14 '14 11:05 bagusflyer

I'm also having a similar problem:

> [email protected] install /Users/ecilteodoro/.nvm/v0.11.13/lib/node_modules/tty.js/node_modules/pty.js
> node-gyp rebuild

  CXX(target) Release/obj.target/pty/src/unix/pty.o
../src/unix/pty.cc:65:15: error: unknown type name 'Arguments'; did you mean 'v8::internal::Arguments'?
PtyFork(const Arguments&);
              ^~~~~~~~~
              v8::internal::Arguments

But this is just the first of a series of errors, mostly related to node-gyp.
Note: node-gyp and XCode command-line tools are properly installed. OSX Mavericks 10.9.3.

ghost avatar May 22 '14 10:05 ghost

Yes. I found the node-gyp is installed. You have any workaround to fix the tty.js installation problem?

在 2014年5月22日,下午06:43,arctouch-ecilteodoro [email protected] 写道:

I'm also having a similar problem:

[email protected] install /Users/ecilteodoro/.nvm/v0.11.13/lib/node_modules/tty.js/node_modules/pty.js node-gyp rebuild

CXX(target) Release/obj.target/pty/src/unix/pty.o ../src/unix/pty.cc:65:15: error: unknown type name 'Arguments'; did you mean 'v8::internal::Arguments'? PtyFork(const Arguments&); ^~~~~~~~~ v8::internal::Arguments But this is just the first of a series of errors, mostly related to node-gyp.

Note: node-gyp and XCode command-line tools are properly installed. OSX Mavericks 10.9.3.

— Reply to this email directly or view it on GitHub.

bagusflyer avatar May 22 '14 11:05 bagusflyer

Not yet. Which version of node are you using? I'm using the latest v0.11.13. I'll try with an earlier version and will let you know.

ghost avatar May 22 '14 11:05 ghost

I don't have a much earlier version of node. I tested with v0.11.12 and it broke when installing pty.js.

ghost avatar May 22 '14 11:05 ghost

v0.10.26.

Maybe I’ll upgrade the version first.

Thanks.

在 2014年5月22日,下午07:02,arctouch-ecilteodoro [email protected] 写道:

Not yet. Which version of node are you using? I'm using the latest v0.11.13. I'll try with an earlier version and will let you know.

— Reply to this email directly or view it on GitHub.

bagusflyer avatar May 22 '14 11:05 bagusflyer

The latest version is v0.10.28 in nodejs official website.

在 2014年5月22日,下午07:07,arctouch-ecilteodoro [email protected] 写道:

I don't have a much earlier version of node. I tested with v0.11.12 and it broke when installing pty.js.

— Reply to this email directly or view it on GitHub.

bagusflyer avatar May 22 '14 11:05 bagusflyer

Here's how I could work around this issue:

npm uninstall -g tty.js
git clone https://github.com/chjj/pty.js.git /tmp/pty.js
vim /tmp/pty.js/src/unix/pty.cc

Change line 39 to:

#include "/usr/include/util.h"

Save and exit vim (:qw)

npm install -g /tmp/pty.js
git clone https://github.com/chjj/tty.js /tmp/tty.js
vim /tmp/tty.js/package.json

Remove line for pty dependency ( "pty.js": "0.2.4", ) then save&exit

npm install -g /tmp/tty.js

That's it.

thirstyfish avatar Aug 01 '14 09:08 thirstyfish

It worked beautifully! Thanks!

ghost avatar Aug 01 '14 14:08 ghost

@thirstyfish: thanks for the workaround.

andyearnshaw avatar Aug 19 '14 09:08 andyearnshaw

that worked for me too, thanks !

st32lthx avatar Sep 11 '14 18:09 st32lthx

Also worked for me in Mac OS 10.9.4. Thanks

hpenedones avatar Sep 21 '14 18:09 hpenedones

fatal error: '/usr/include/util.h' file not found

stevenvachon avatar Oct 05 '14 05:10 stevenvachon

@stevenvachon Did you install Xcode and the command line developer tools (you can do this from the terminal via xcode-select --install and it should pop up a window asking you to install)?

mscdex avatar Oct 05 '14 05:10 mscdex

Thanks @mscdex. That solved it.

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

@thirstyfish Kudos to you!! Thanks for the answer. Xocde-6.1 w/ CLI Tools

jtryan avatar Oct 23 '14 01:10 jtryan

Thanks @thirstyfish ! Your work-around worked on Mac OS 10.10 and node v0.10.33 today.

ivanoats avatar Nov 07 '14 18:11 ivanoats

Works on 10.10.1

hew avatar Dec 04 '14 09:12 hew

Working on io 1.3.0 :+1: thanks!

ddelapaz avatar Mar 19 '15 12:03 ddelapaz