Can anyone assist me with this issue? I can’t seem to find the issue and could use a little assistance. Appreciate any help.
PostCSS Sorting Couldn't find Node.js. Make sure it's in your $PATH by running `node -v` in your command-line
When I run node -v I get this result: v16.15.0 - I even told nvm to use that specific version.
What OS are you on? This kind of problem can happen on MacOS in cases where the Terminal has access to the appropriate $PATH
environment variable but Sublime doesn’t, for example.
It appears the package incorrectly tries to extend $PATH
variable on MacOS, which may drive it invalid. IMHO, line 14 misses :
path separator.
It should proabably look like env['PATH'] += ':' + os.path.expanduser('~/n/bin')
.
ST4 reads environment variables such as $PATH
from login shell upon startup. Hence, I’d guess, the whole block (line 11 to 15) is no longer needed.
Package seems no longer maintained, so patching locally seems to be the only option.
node_bridge.py
import os
import platform
import subprocess
IS_OSX = platform.system() == 'Darwin'
IS_WINDOWS = platform.system() == 'Windows'
def node_bridge(data, bin, args=[]):
startupinfo = None
if IS_WINDOWS:
startupinfo = subprocess.STARTUPINFO()
startupinfo.dwFlags |= subprocess.STARTF_USESHOWWINDOW
try:
p = subprocess.Popen(['node', bin] + args,
stdout=subprocess.PIPE, stdin=subprocess.PIPE, stderr=subprocess.PIPE,
startupinfo=startupinfo)
except OSError:
raise Exception('Couldn\'t find Node.js. Make sure it\'s in your $PATH by running `node -v` in your command-line.')
stdout, stderr = p.communicate(input=data.encode('utf-8'))
stdout = stdout.decode('utf-8')
stderr = stderr.decode('utf-8')
if stderr:
raise Exception('Error: %s' % stderr)
else:
return stdout
Oh, my goodness. This is wonderful - and I would be remiss if I didn’t thank you both for taking the time to assist me. It is very much appreciated. I’ll try this solution later this evening. I’ll report back.