Sublime Forum

ST4 as Admin -> WinError 5

#1

this started with a recent post and has now escalated to anything trying to use node.exe. what’s frustrating is that i’m running ST4 as admin. so in conjunction with wide open permissions, i cannot fathom what’s going on here. Any package that uses node.exe fails with the WinError 5 in the console. ESlint? Fail. Prettier? Fail.

to make matters more frustrating, i have node.exe in a few paths (because a lot of softwares just bundle it in there!), all present in the main system PATH and all wide-open, permission-wise. no matter what path i use for any package settings, it errors out.

i don’t know where to go next troubleshooting this damn thing… >_< suggestions?

0 Likes

#2

If you open the Sublime console with View > Show Console and enter the below line and hit enter, what happens?

window.run_command('exec', {'shell_cmd': 'node --version'})

This should do nothing but execute some version of node that’s on the PATH and ask it to print it’s version.

Since it’s not accessing any files, it should work just fine as a first step.

Note also that you don’t need to run Sublime as Admin to make something like this work. The error message “access denied” makes it sound like the problem is permission related, but you get the same error doing this:

window.run_command('exec', {'cmd': ['c:/']})

Is this because you don’t have permissions to access the root of the C drive? No, it’s because you can’t run a folder, you can only run a program.

This is not to say that there isn’t a permissioning problem of some kind, it’s just something to keep in mind because a lot of people get caught with that.

This can happen if for example the configuration that specifies where node is only specifies the folder that it’s installed in and doesn’t point at the executable itself.

For example, this works:

window.run_command('exec', {'cmd': ['D:/Program Files/nodejs/node.exe', '--version']})

But this generates WinError 5:

window.run_command('exec', {'cmd': ['D:/Program Files/nodejs/', '--version']})

All that said, from your other thread it seems like like is not the issue, but that first test at the top there will at least let you know if Node is runnable or not as your user.

1 Like

#3

okay. i CAN get the command to run correctly from the console (with and without running as admin). it reports the correct version number. so what i can’t figure out is, with the full path in the settings (C:\Program Files\nodejs\node.exe), and with open permissions (*hurk*), i’m still getting the [WinError 5] when i try to run any package that uses node.exe. what would be the next steps? and, thank you, btw, for your help so far.

0 Likes

#4

Does the Sublime console show any logs or errors from the package that might indicate what it was trying to do when it failed?

0 Likes

#5

unfortunately, no. just an error. :stuck_out_tongue_closed_eyes:

0 Likes