Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Sublime couldn't find Node.js

I have had this very same problem happen with another Sublime Package - something isn't configured correctly on my Mac.

I installed CSSComb with npm install -g csscomb.

I installed the CssComb Sublime package using Sublime's "Package Installer".

I've restarted Sublime.

When I try to use CSSComb in Sublime, the console has the error:

Traceback (most recent call last):
File "/Applications/Sublime Text.app/Contents/MacOS/sublime_plugin.py", line 818, in run_
return self.run(edit)
File "/Users/alan/Library/Application Support/Sublime Text 3/Packages/CSScomb/CSScomb.py", line 35, in run
combed = self.comb(originalBuffer, syntax, config)
File "/Users/alan/Library/Application Support/Sublime Text 3/Packages/CSScomb/CSScomb.py", line 48, in comb
'$PATH by running `node -v` in your command-line.')
Exception: Couldn't find Node.js. Make sure it's in your $PATH by running `node -v` in your command-line.`

Running node -v outputs v7.0.0

Running echo $PATH outputs: /Users/alan/.nvm/versions/node/v7.0.0/bin:/Users/alan/.rbenv/shims:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin

Within Sublime I have modified the path to node in the CSSComb configuration file:

"node-path" : "/Users/alan/.nvm/versions/node/v7.0.0/bin",

Still get the same error in Sublime console. Any help is appreciated.

like image 831
Alan P. Avatar asked Mar 27 '26 20:03

Alan P.


1 Answers

From the README:

If node has been installed with NVM you need to make a symlink to node in /usr/local/bin. Using OS X, the binary path would typically be /Users/[your name]/.nvm/[node version]/bin/node.

Open terminal and run the following:

sudo ln -s /Users/alan/.nvm/versions/node/v7.0.0/bin/node /usr/local/bin/node

Then change the CSSComb settings file to:

"node-path": ":/usr/local/bin", // the colon ":" is important!

and see if that works.

like image 120
MattDMo Avatar answered Mar 29 '26 10:03

MattDMo



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!