victorporof / Sublime-HTMLPrettify

HTML, CSS, JavaScript, JSON, React/JSX and Vue code formatter for Sublime Text 2 and 3 via node.js
https://github.com/victorporof/Sublime-HTMLPrettify
1.93k stars 260 forks source link

Plugin always uses $NVM_BIN instead of the user-specified path #605

Open jdjoshuadavison opened 5 years ago

jdjoshuadavison commented 5 years ago

I have been using this plugin for a long time without any issues and I've never had the path specified in HTMLPrettify.sublime-settings. I have node installed using NVM. Until recently I only had v10.9.0 installed, but a month or so ago I installed node v10.10.0 and switched that to be my default node version. HTMLPrettify continued to work fine as did everything else that uses Node.

Today, I uninstalled and removed v10.9.0 from NVM. Everything else that uses node has continued to work, but HTMLPrettify stopped working. The console error message shows me that it is for some reason still looking for v10.9.0:

Node.js was not found in the default path: [Errno 2] No such file or directory: '/Users/<username>/.nvm/versions/node/v10.9.0/bin/node'

How/why is HTMLPrettify still attempting to use v10.9.0?

Presumably if I reinstall v10.9.0 it will start working again, but I'd rather find the solution than a workaround.

Thanks, Josh

victorporof commented 5 years ago

What's the output in sublime's console?

victorporof commented 5 years ago

Also, check out latest release, in case it helps: https://github.com/victorporof/Sublime-HTMLPrettify/releases

jdjoshuadavison commented 5 years ago

What's the output in sublime's console?

Sorry, I didn't format my original post very well (I've edited it for clarity now), but I did include it in there. For convenience, here it is again:

Node.js was not found in the default path: [Errno 2] No such file or directory: '/Users/<username>/.nvm/versions/node/v10.9.0/bin/node'

Also, check out latest release, in case it helps: https://github.com/victorporof/Sublime-HTMLPrettify/releases

I've just updated to the latest version from package control 2018.09.30.11.18.12 and I'm still getting the same results.

Thanks, Josh

victorporof commented 5 years ago

There's more output in sublime's console related to this plugin, can you post all of it?

Is there any difference between starting Sublime from the commandline vs. as a regular app?

jdjoshuadavison commented 5 years ago

Sorry, but there isn't more output related to this plugin. I've attached a screenshot below.

There is no difference when opening from command line (which I did with open /Applications/Sublime\ Text.app unless this is not what you meant?)

Is there a command I can run for more detailed logging?

In case it's helpful here are some system details...

screen shot 2018-10-01 at 19 49 58
diegocanal commented 5 years ago

Have you tried the solution provided by @shlllshlll in Issue #613?:

A temporary solution:Go to the sublime packages folder, then go to HTML-CSS-JS Prettify. Finaly run npm install core-js in the current folder.

It worked for me.

victorporof commented 5 years ago

@diegocanal Thanks for messaging everybody before I managed to get to fix things :) This issue is actually about something else though.

victorporof commented 5 years ago

@jdjoshuadavison Can you confirm that the path you specified to nodejs actually exists?