简体   繁体   中英

WinError 5 when attempting to run JS from Sublime Text

I've implemented a JavaScript console into Sublime Text 3 using node.js.

Build code (saved as Node.sublime-build ):

{
"cmd": ["node /Program Files/nodejs", "$file"],
"selector": "source.js"
}

It originally gave WinError 2 which meant it couldn't find node.js. I fixed that by adding the file location.


Now, it gives [WinError 5] Access is denied . Doing some research, I discovered the solution of "Run as Administrator". Unfortunately, that didn't work.

My JavaScript is perfectly valid and node.js has been installed.

What is the problem? Do I have to reinstall node.js with the permission to connect to my PATH? (I deselected that during installation)

The error was in the installation of node.js.

In my original installation, I unchecked Implement into command line (or something similar) which didn't allow it to "plant" itself into my system.

I reinstalled node.js with that option checked and it works now!

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM