Sublime Forum

Help! The Error about node_path of sublime test plugin

#1

I used Cmder to opened the ST3, and then when I used plugin of ST3 which need base on the nodejs(HTML-CSS-JS Prettify), the console ST3 told me <Node.js was not found in the default path. Please specify the location.>

But I’m already specified the nodejs path like this:
“node_path”: {
“windows”: “C:\Program Files\nodejs\node.exe”,
“linux”: “/usr/bin/nodejs”,
“osx”: “/usr/local/bin/node”
}

It worked good without Cmder,only appeared Error when uesed Cmder,this is the Error:

Using node.js path on 'windows': C:\Program Files\nodejs\node.exe Unexpected error(<class 'OSError'>): [WinError 6] 句柄无效。 Traceback (most recent call last): File "E:\Sublime Text 3\sublime_plugin.py", line 818, in run_ return self.run(edit) File "C:\Users\Administrator\AppData\Roaming\Sublime Text 3\Packages\HTML-CSS-JS Prettify\HTMLPrettify.py", line 49, in run print(self.get_output_diagnostics(output)) File "C:\Users\Administrator\AppData\Roaming\Sublime Text 3\Packages\HTML-CSS-JS Prettify\HTMLPrettify.py", line 111, in get_output_diagnostics index = output.find(OUTPUT_VALID) AttributeError: 'NoneType' object has no attribute 'find'

Is there someone knows what’s wrong with it? Thank a lot for your help!

2 Likes

#2

It’s another case where ST throws [WinError 6] when started from command line on windows. I am on the same boat here. For me it’s the build system that’s complaining. Did you find out how to solve that problem? If you have I’d love to know.

0 Likes

#3

This is not Sublime’s fault! It is a well known bug of subproces.POpen of python 3.3 which fails on Windows if not passed a valid stdin argument.

The HTML-CSS-JS Prettify does NOT pass this argument at all.

See HTMLPrettify Line 207:

 return subprocess.Popen(cmd, \
  stdout=subprocess.PIPE, \
  startupinfo=startupinfo).communicate()[0]

You’d need to change this code line as follows to fix the bug.

 return subprocess.Popen(cmd, \
  stdin=subprocess.PIPE, \
  stderr=subprocess.PIPE, \
  stdout=subprocess.PIPE, \
  startupinfo=startupinfo).communicate()[0]
1 Like