Comments (8)
Sorry for the obvious question, but does /Users/lib/node_modules/tty.js/index.js
exist? That's really strange.
from tty.js.
Negatory. Note that it's looking in /Users
for some reason. When really it should be looking in /usr/local/lib/node_modules
:
☮ ~ (master) ⚡ which tty.js
/usr/local/bin/tty.js
☮ ~ (master) ⚡ ls -l /usr/local/lib/node_modules/tty.js/
total 16K
-rw-r--r-- 1 nrajlich wheel 1.1K Feb 3 00:01 LICENSE
-rw-r--r-- 1 nrajlich wheel 3.2K Apr 4 03:18 README.md
drwxr-xr-x 3 nrajlich wheel 102 Apr 9 08:02 bin/
-rw-r--r-- 1 nrajlich wheel 42 Feb 2 09:48 index.js
drwxr-xr-x 4 nrajlich wheel 136 Apr 9 08:02 lib/
drwxr-xr-x 3 nrajlich wheel 102 Apr 9 08:02 man/
drwxr-xr-x 6 nrajlich wheel 204 Apr 9 08:02 node_modules/
-rw-r--r-- 1 nrajlich wheel 1.1K Apr 9 08:02 package.json
drwxr-xr-x 7 nrajlich wheel 238 Apr 9 08:02 static/
Try it yourself, I'm sure it'll happen for you too.
from tty.js.
Seems like you're not using dirname(1)
properly. This patch makes things work for me:
diff --git a/bin/tty.js b/bin/tty.js
index d824a74..9f8f841 100755
--- a/bin/tty.js
+++ b/bin/tty.js
@@ -4,7 +4,9 @@ f=$0
while test -L "$f"; do
f=$(readlink "$f")
done
-dir="$(dirname "$f")/.."
+dir=`dirname "$f"`
+dir=`dirname "$dir"`
+dir=`readlink -f "$dir"`
node=$(which node 2>/dev/null)
if test -z "$node"; then
from tty.js.
Oh, I think I figured out the problem. My readlink resolution doesn't take into account relative symlinks (I can't use readlink -f
there because it's not portable), so if it hits a link that's relative, it won't be able to resolve the path correctly and end up giving you a weird one instead.
from tty.js.
@TooTallNate Unfortunately this doesn't work on Mac OS X as the included version of readlink
doesn't support the -f
flag. I'm not sure of a better solution, I came across this, but it doesn't seem great: http://serverfault.com/questions/40144/how-can-i-retrieve-the-absolute-filename-in-a-shell-script-on-mac-os-x
from tty.js.
@chjj If I were you I would just rewrite this startup script in node; would make things a lot simpler.
from tty.js.
@TooTallNate, I originally chose a bash script because it's easier to daemonize the process. I'll rewrite it in node though.
from tty.js.
Fixed for next release. The start script was rewritten in node.
from tty.js.
Related Issues (20)
- cannot build tty.js : HOT 1
- Programatically run commands into terminal HOT 1
- Include readme instructions for username / password HOT 1
- Windows 10, unable to install HOT 2
- Print text on a terminal
- Is it possible to disable authentification HOT 1
- Can't type in arobase or accentuated char from Windows Chrome HOT 3
- tty.js dont install on windows HOT 1
- Cant Use tty.js with Python urllib module
- TypeError: Cannot read property 'prototype' of undefined HOT 18
- local log file
- MySQL connection and print data to index.html
- Some Times I use WiFi,but it take a long time to get connection to server
- State of PTY is not maintained when reopening the old PTY process
- node-gyp.js rebuild fails HOT 1
- is this library still maintained? any better alternative? HOT 1
- new branch of tty.js HOT 3
- Cannot find module 'pty.js' even though it has been installed. Fixed it!
- Installation fails on macOS with node v10.8.0
- node-gyp rebuild error
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from tty.js.