chjj / tty.js

A terminal for your browser, using node/express/socket.io
MIT License
4.2k stars 483 forks source link

Can't install in mac osx #115

Open bagusflyer opened 10 years ago

bagusflyer commented 10 years ago

I got errors when I ran the command:

sudo npm install -g tty.js

The error messages are:

pty.js@0.2.3 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! pty.js@0.2.3 install: node-gyp rebuild npm ERR! Exit status 127 npm ERR! npm ERR! Failed at the pty.js@0.2.3 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 commented 10 years ago

I installed the node-gyp by:

sudo npm install -g node-gyp

But can't solve the problem.

bagusflyer commented 10 years ago

Any idea?

bagusflyer commented 10 years ago

Anybody encounter the same issue?

ghost commented 10 years ago

I'm also having a similar problem:

> pty.js@0.2.3 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.

bagusflyer commented 10 years ago

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 notifications@github.com 写道:

I'm also having a similar problem:

pty.js@0.2.3 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.

ghost commented 10 years ago

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 commented 10 years ago

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

bagusflyer commented 10 years ago

v0.10.26.

Maybe I’ll upgrade the version first.

Thanks.

在 2014年5月22日,下午07:02,arctouch-ecilteodoro notifications@github.com 写道:

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 commented 10 years ago

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

在 2014年5月22日,下午07:07,arctouch-ecilteodoro notifications@github.com 写道:

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.

thirstyfish commented 10 years ago

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.

ghost commented 10 years ago

It worked beautifully! Thanks!

andyearnshaw commented 10 years ago

@thirstyfish: thanks for the workaround.

st32lthx commented 10 years ago

that worked for me too, thanks !

hpenedones commented 10 years ago

Also worked for me in Mac OS 10.9.4. Thanks

stevenvachon commented 10 years ago
fatal error: '/usr/include/util.h' file not found
mscdex commented 10 years ago

@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)?

stevenvachon commented 10 years ago

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.

jtryan commented 10 years ago

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

ivanoats commented 10 years ago

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

hew commented 9 years ago

Works on 10.10.1

ddelapaz commented 9 years ago

Working on io 1.3.0 :+1: thanks!