简体   繁体   English

尝试从Sublime Text运行JS时出现WinError 5

[英]WinError 5 when attempting to run JS from Sublime Text

I've implemented a JavaScript console into Sublime Text 3 using node.js. 我已经使用node.js在Sublime Text 3中实现了JavaScript控制台。

Build code (saved as Node.sublime-build ): 构建代码(保存为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. 它最初提供了WinError 2 ,这意味着它找不到node.js。 I fixed that by adding the file location. 我通过添加文件位置来解决该问题。


Now, it gives [WinError 5] Access is denied . 现在,它给出[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. 我的JavaScript完全有效,并且已经安装了node.js。

What is the problem? 问题是什么? Do I have to reinstall node.js with the permission to connect to my PATH? 我是否必须具有权限才能重新安装node.js才能连接到PATH? (I deselected that during installation) (我在安装过程中取消了选择)

The error was in the installation of node.js. 错误是在安装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. 在我的原始安装中,我未选中“ Implement into command line (或类似内容)中,这不允许它“自行”植入我的系统。

I reinstalled node.js with that option checked and it works now! 我重新安装了node.js并选中了该选项,它现在可以工作!

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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