Hirse / brackets-ungit

Brackets Extension to view Ungit directly in Brackets
MIT License
22 stars 5 forks source link

/bin/sh: npm: command not found #2

Open G07cha opened 8 years ago

G07cha commented 8 years ago

I have tried to install ungit through Brackets Ungit but recieved message provided in title, then i installed ungit through terminal, all works fine if use 'ungit' command in terminal, but even after reinstalling extension i still recieving message from header while trying to open ungit from side panel

❯ npm -v 2.13.1 ❯ which npm /usr/local/bin/npm ❯ uname Darwin ❯ /bin/sh npm /usr/local/bin/npm: npm: line 2: syntax error near unexpected token ;' /usr/local/bin/npm: npm: line 2:;(function () { // wrapper in case we're in module_context mode'

Hirse commented 8 years ago

The extension just calls npm install in the extension folder because it uses a local installation of Ungit. If you get an error during the self-installation you can do this step yourself before you open Brackets:

  1. Go to the extension folder
    1. In Brackets Help > Show Extensions Folder (and close Brackets)
    2. Go to user/hirse.ungit
  2. Run npm install and make sure it finishes and creates the node_modules in that extension folder.

When you say that you can use the ungit command in the terminal, it means that you installed Ungit globally, right? The extension (currently) doesn't look for any global installations.

Are you sure npm is working and is globally available?

G07cha commented 8 years ago

Tried your guide, looks like ungit installed succefully, here some warn logs that actually don't looks like it's really bad

❯ npm install ungit
npm WARN engine forever-monitor@1.1.0: wanted: {"node":"0.8.x"} (current: {"node":"0.12.4","npm":"2.13.1"})

> typechecker@2.0.8 preinstall /Users/user/Library/Application Support/Brackets/extensions/user/hirse.ungit/node_modules/ungit/node_modules/getmac/node_modules/extract-opts/node_modules/typechecker
> node ./cyclic.js

npm WARN engine hawk@0.10.2: wanted: {"node":"0.8.x"} (current: {"node":"0.12.4","npm":"2.13.1"})
npm WARN engine sntp@0.1.4: wanted: {"node":"0.8.x"} (current: {"node":"0.12.4","npm":"2.13.1"})
npm WARN engine boom@0.3.8: wanted: {"node":"0.8.x"} (current: {"node":"0.12.4","npm":"2.13.1"})
npm WARN engine hoek@0.7.6: wanted: {"node":"0.8.x"} (current: {"node":"0.12.4","npm":"2.13.1"})
npm WARN engine cryptiles@0.1.3: wanted: {"node":"0.8.x"} (current: {"node":"0.12.4","npm":"2.13.1"})

node_modules folder created, I've reloaded Brackets, opened ungit from left sidebar and recieved this:

screen shot 2015-07-30 at 11 06 45 am

Seems like ungit don't started, here error from Devtools console:

GET http://localhost:8448/ net::ERR_CONNECTION_REFUSED
Hirse commented 8 years ago

Yes, those warnings always occur. The ungit dependencies seem to be a bit out of date.

I have had that problem before as well. I am not sure how it happens and I haven't found a good way to detect it in the code. Try to kill ungit by using Navigate > Stop Ungit and open the viewer again.

G07cha commented 8 years ago

Same result, developer console don't give any additional information

Hirse commented 8 years ago

I am working on the issue.

Can you open ungit in your browser after you opened it in Brackets?

G07cha commented 8 years ago

No, ungit by default address http://localhost:8448 is unreachable, but i still can start ungit from extensions folder

Hirse commented 8 years ago

So the whole ungit process is not started by the extension, right?

btw, what OS are you on. I only have Windows and wasn't able to test on anything else.

G07cha commented 8 years ago

Right, I'm using OS X Yosemite 10.10.5. i'll try to check on Ubuntu and report results here.

Hirse commented 8 years ago

Thanks for your effort.

Hirse commented 8 years ago

Can you apply the latest commit from GitHub and see if that improves the situation?

G07cha commented 8 years ago

Installed, still getting same message as in header.

G07cha commented 8 years ago

Checked on Ubuntu, untag installed succefully but don't displaying content and looks same as https://github.com/Hirse/brackets-ungit/issues/2#issuecomment-126220408 but this is another problem

Hirse commented 8 years ago

I just set up my computer again (Update to Windows 10) and got an error myself during the installation of this extension. The reason is that I did not install node.js (and therefore npm) yet. Are you sure you have npm installed and globally available?

G07cha commented 8 years ago

Yep, npm goes with nodeJS if download from offical website, after installing i've updated node manually and here an output:

❯ which npm
/usr/local/bin/npm

to compare, here an output from Ubuntu:

$ which npm
/usr/bin/npm

I've reinstalled npm using Brew(OS X package manager) and recieved same path as first time.