benschwarz / sublime-bower

Install Bower packages from within Sublime
MIT License
226 stars 12 forks source link

Error on Windows 8 64bit #11

Closed getsetbro closed 11 years ago

getsetbro commented 11 years ago

I added it to Sublime Text 2 on Win8 x64 via the Package Control. When try to add anything via Bower I get this error.

" bower.cmd could not be found in your $PATH. Install bower with npm install bower -g "

Melindrea commented 11 years ago

Interestingly enough, I get about the same error on Ubuntu 64bit. Difference is that my error message says just "bower", not "bower.cmd"

Melindrea commented 11 years ago

The issue most likely lies in that the path that python from within ST has access to may not be the same that other parts of the system has access to. This obviously assumes you can add things via Bower through other means =)

In my case (Ubuntu 12.04) I had to add the exported paths to my .profile file, and unfortunately I'm unsure how that would be done in Windows.

To check if that is the issue you are running into, show the python console and write in the following:

import os
os.environ['PATH']

One temporary solution might be to add a shortcut to the bower file (wherever it is) into one of the paths that it is recognizing.

Den-dp commented 11 years ago

Windows XP - same thing :\

bower.cmd could not be found in your $PATH. Install bower with npm install bower -g

benschwarz commented 11 years ago

Can either of you run "bower" in command line? 

Melindrea commented 11 years ago

In my case, yes. I solved my issue when I finally found how to expose the $PATH to the GUI.

benschwarz commented 11 years ago

Can you please document them so I can figure out how to support windows better?

Melindrea commented 11 years ago

Sorry, I only do Ubuntu, but for Ubuntu it has to do with adding the path to find bower in the .profile file.

which bower to find where it is, and then add PATH=$PATH:<path to bower> to ~/.profile

moonpyk commented 11 years ago

On windows (any version) bower.cmd resides in %APPDATA%\npm (the user global node package directory). In normal conditions the NodeJs installer is adding this path to "HKCU\Environment\PATH" registry variable, so no further user actions are required to run node package commands in the terminal later (or call bower.cmd from other apps).

When run on *NIX sublime-bower's cli.py is pushing additional hint paths into the environment, using the LOCAL_PATH variable (pushing ':/usr/local/bin:/usr/local/sbin:/usr/local/share/npm/bin'), but not (yet) on Windows, the variable is initialized empty, i'll address a patch that fixes that tomorrow.

benschwarz commented 11 years ago

@moonpyk, whatever you can do to help is appreciated. I'm not a windows user at all, so I'm totally in the dark :-1:

moonpyk commented 11 years ago

Again some issues ?

benschwarz commented 11 years ago

I reopened the issue so we can track through the patch that you said you'd send tomorrow

moonpyk commented 11 years ago

Yup maybe you closed the issue a bit fast :smile: Uh in fact the patch i was supposed to send tomorrow is the pull request I did today (it's 3AM here, but seems I have an insomnia)

benschwarz commented 11 years ago

@Den-dp @Melindrea @getsetbro - Can you all please update the plugin and retest? @moonpyk did a bunch of awesome work for Widnows support… I think we're about there now.

getsetbro commented 11 years ago

I just got bower through the package manager again. I have the same error when I try to get a library.

benschwarz commented 11 years ago

@moonpyk, any thoughts? @getsetbro, did you try restarting sublime editor and trying again?

moonpyk commented 11 years ago

@getsetbro could you open a cmd.exe, type "cd %APPDATA%\npm" then "dir" and paste the output here ?

getsetbro commented 11 years ago

03/24/2013 08:05 PM

. 03/24/2013 08:05 PM .. 03/24/2013 08:05 PM node_modules 0 File(s) 0 bytes

moonpyk commented 11 years ago

bower is not installed. try again "npm install -g bower"

getsetbro commented 11 years ago

ok, but that is sort of the point of this error. That installing it with the package manager is not installing it on systems like mine.

moonpyk commented 11 years ago

This is really weird, my laptop is a 64b windows 8 and i have no problem. Which version of node and npm are you running ?

getsetbro commented 11 years ago

node --version v0.10.0

npm --version 1.2.14

It is working for me now that I installed Bower via CMD and with the package manager in sublime.

moonpyk commented 11 years ago

So everything works now ?

getsetbro commented 11 years ago

Is it supposed to install everything needed via the package manager? Or are you supposed to install it with both - npm and in sublime text?

moonpyk commented 11 years ago

Both, Sublime-Bower is just an interface to the system bower.

getsetbro commented 11 years ago

ok then, the problem was that I had only added Sublime-Bower and not both.

moonpyk commented 11 years ago

@benschwarz We should add a note in the README regarding that, people have to make suke that bower is working out of sublime text before trying to make it work inside sublime.

benschwarz commented 11 years ago

Thanks for covering it @moonpyk, I thought it was already pretty clearly listed under dependencies… perhaps I'll merge that into the install header, so it can't be missed.

kangarooo commented 8 years ago

Having error still on Windows 8.1 following instructions. bower.cmd could not be found path Read https://github.com/benschwarz/sublime-bower/ Something like that in messege