devtools-terminal icon indicating copy to clipboard operation
devtools-terminal copied to clipboard

New Node.js installation not working

Open nieldlr opened this issue 10 years ago • 18 comments

Hey @petethepig,

I installed the Node.js module and told Chrome where to find it. However, when I open up the terminal it still shows the installation message/prompt. I rebooted Chrome, still nothing.

Anything I can do to get this working? I'd love to help troubleshoot!

nieldlr avatar Jan 16 '14 14:01 nieldlr

What OS do you use?

petethepig avatar Jan 16 '14 14:01 petethepig

same here using ubuntu 13.04

p3k avatar Jan 16 '14 14:01 p3k

I'm on OSX Mavericks and on the latest Chrome release.

Node version v0.10.15 NPM v1.3.5

nieldlr avatar Jan 16 '14 14:01 nieldlr

Okay,

When you do sudo devtools-terminal --install, it creates a new file at /Library/Google/Chrome/NativeMessagingHosts/com.dfilimonov.devtoolsterminal.json Can you tell me what's in it?

Also, can you show me the output of this command which node ?

Thanks

petethepig avatar Jan 16 '14 14:01 petethepig

Sure thing! :)

JSON output: { "name": "com.dfilimonov.devtoolsterminal", "description": "Devtools Terminal", "path": "/Users/nieldlr/.nvm/v0.10.15/lib/node_modules/devtools-terminal/bin/nm-host.sh", "type": "stdio", "allowed_origins": [ "chrome-extension://leakmhneaibbdapdoienlkifomjceknl/" ] }

And which node: /Users/nieldlr/.nvm/v0.10.15/bin/node

nieldlr avatar Jan 16 '14 14:01 nieldlr

Okay, so there's been a bug and this little script here Users/nieldlr/.nvm/v0.10.15/lib/node_modules/devtools-terminal/bin/nm-host.sh couldn't find node executable. Now, I think I fixed it :) I also updated the npm package, so I suppose if you run npm install devtools-terminal -g once again the whole thing will work just fine.

petethepig avatar Jan 16 '14 15:01 petethepig

not for me, unfortunately :grimacing:

p3k avatar Jan 16 '14 15:01 p3k

Awesome it worked! I tried it without the global flag (-g) but it didn't work. But with the global flag it worked:

npm install -g devtools-terminal

nieldlr avatar Jan 16 '14 15:01 nieldlr

Oh, sure, I forgot about the -g flag.

Thanks for helping me investigate this!

petethepig avatar Jan 16 '14 15:01 petethepig

Hey, p3k Can you please show me the output of which node and the content of /etc/opt/chrome/native-messaging-hosts/com.dfilimonov.devtoolsterminal

And, as mentioned above, the right command is npm install -g devtools-terminal, with the -g flag.

Thanks!

petethepig avatar Jan 16 '14 15:01 petethepig

$ which node
/usr/bin/node

$ cat /etc/opt/chrome/native-messaging-hosts/com.dfilimonov.devtoolsterminal.json
{
  "name": "com.dfilimonov.devtoolsterminal",
  "description": "Devtools Terminal",
  "path": "/usr/lib/node_modules/devtools-terminal/bin/nm-host.sh",
  "type": "stdio",
  "allowed_origins": [
    "chrome-extension://leakmhneaibbdapdoienlkifomjceknl/"
  ]
}

i tried it with the -g flag, too, after your update.

p3k avatar Jan 16 '14 15:01 p3k

Can you check if this file /usr/lib/node_modules/devtools-terminal/bin/nm-host.sh has executable rights?

ls -l /usr/lib/node_modules/devtools-terminal/bin/nm-host.sh

petethepig avatar Jan 16 '14 19:01 petethepig

I'm also having this issue.. installed with npm (as sudo, with -g flag), ran devtools-terminal with the install flag per the instructions, still only getting the info screen. If i run 'devtools-terminal', I can see socket.io starting up and it appears to sit idle, waiting for events, so i'm guessing it has found node correctly from the terminal at least. Running linux mint 15.

09:47:06 ~$ which node
/usr/local/bin/node
09:47:08 ~$ cat /etc/opt/chrome/native-messaging-hosts/com.dfilimonov.devtoolsterminal.json 
{
  "name": "com.dfilimonov.devtoolsterminal",
  "description": "Devtools Terminal",
  "path": "/usr/local/lib/node_modules/devtools-terminal/bin/nm-host.sh",
  "type": "stdio",
  "allowed_origins": [
    "chrome-extension://leakmhneaibbdapdoienlkifomjceknl/"
  ]
}

nefD avatar Jan 17 '14 14:01 nefD

Please, check if this file is executable /usr/local/lib/node_modules/devtools-terminal/bin/nm-host.sh

petethepig avatar Jan 17 '14 15:01 petethepig

It is

12:27:52 /usr/local/lib/node_modules/devtools-terminal/bin$ ls -al
total 24
drwxr-xr-x 2 nobody cmartin 4096 Jan 17 09:31 .
drwxr-xr-x 4 nobody cmartin 4096 Jan 17 09:31 ..
-rwxr-xr-x 1 nobody cmartin 8063 Jan 15 14:15 devtools-terminal
-rw-r--r-- 1 nobody cmartin  170 Jan 15 14:10 nm-host.bat
-rwxr-xr-x 1 nobody cmartin  184 Jan 16 10:32 nm-host.sh

nefD avatar Jan 17 '14 17:01 nefD

Figure this out. I had to click the dots in the top right, click Remote Connection, and then I provided 'http://localhost:8080' for the url, 'admin' for the user, and no password.

nefD avatar Jan 21 '14 17:01 nefD

nefD, I also can make it work with Remote Connection. But first I should start 'devtools-terminal' in bash every time when I want to use it. As I understand that is how it work via Websocket. But by default it should work via NPAPI (sudo devtools-terminal --install --id=leakmhneaibbdapdoienlkifomjceknl) - starts automaticly when you open DevTools Terminal. And I also can't get it to work via NPAPI.

AntowaKartowa avatar Jan 29 '14 12:01 AntowaKartowa

I also can't get to work via Native messaging. If i run the nm-host.sh in terminal it exits with error, but if i remove the -l option of #!/bin/bash -l it runs normally, but still not getting the event api.on('init', ...) from the POST. It's like chrome is not initializing the script correctly (I dunno...).

On debugging background.js i get the following logs:

CONNECT
POST Object {event: "init", data: Object}
disconnect
Native host has exited.

ghost avatar Nov 29 '15 04:11 ghost