csscomb / sublime-csscomb

Sublime plugin for CSScomb—CSS coding style formatter
398 stars 61 forks source link

Doesn't work with node installed via NVM (No such file or directory: 'node') #16

Closed zjr closed 9 years ago

zjr commented 10 years ago

I'm running OS X Mavericks, Sublime Text 3.

I have node installed via nvm so the node bin actually sits in /Users/xxx/.nvm/v0.10.26/bin

When CSScomb.py runs env = os.environ.copy(), it gets an super basic environment… not totally sure why, maybe .bash_profile has no effect within sublime?

Anyway, the problem is unless you go and make a symlink in /usr/local/bin for CSScomb to pick up, it's never going to find node when installed via nvm.

If I knew a better way to get the PATH I'd be submitting a pull request. I do figure, however, at the very least you could but this in a "caveats" section in the readme.

This is the root of issue #10

tonyganch commented 9 years ago

You can now set custom path to node in settings: https://github.com/csscomb/sublime-csscomb/blob/master/CSScomb.sublime-settings#L4

joaocunha commented 9 years ago

I had a similar issue with Autoprefixer. Symlinking is the key:

ln -s /Users/joaocunha/.nvm/v0.10.36/bin/node /usr/local/bin/node

More: https://github.com/sindresorhus/sublime-autoprefixer/issues/50

@tonyganch consider adding this to the readme.

airtonix commented 9 years ago

@joaocunha no this is really not the thing to do (tm).

Symlinking userspace into systemspace is a big no no.

also this is broken on linux because the plugin only checks if it's on macosx.