在IntelliJ IDEA中执行JavaScript的项目类型 [英] Project type for executing JavaScript in IntelliJ IDEA
问题描述
是否有任何IntelliJ IDEA项目类型可以让我执行JavaScript,并在控制台中显示结果?
Is there any IntelliJ IDEA project type that allows me to execute JavaScript, showing the results in the console?
我一直在尝试 HTML5_Boilerplate ,但是例如,它需要使用嵌入式脚本来生成HTML.
I've been trying HTML5_Boilerplate, but it requires to generate the HTML with the embedded script, for instance.
谢谢.
更新:只要IDEA的控制台可以做到这一点,IDEA实际上就可以通过利用Node来做到这一点,不需要外部浏览器:
UPDATE: IDEA can actually do it by taking advantage of Node, no need for an external browser, as long as IDEA's console can do the trick:
如何从头开始设置?
推荐答案
IDEA本身无法执行Javascript,只能由浏览器/Node.js解释器执行.项目类型无关紧要.如果希望通过右键菜单中的 Run 命令使用Node.js运行.js
文件,则需要确保已安装 NodeJS 插件,已启用.您可以通过设置|进行安装.插件,安装JetBrains插件...
IDEA itself can't execute Javascript, it can only be executed by browsers/Node.js interpreter. Project type doesn't matter. If you like to be able to run .js
files with Node.js via Run command in right-click menu, you need to make sure that NodeJS plugin is installed and enabled. You can install it via Settings | Plugins, Install JetBrains plugin...
这篇关于在IntelliJ IDEA中执行JavaScript的项目类型的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!