发布于 2021-11-13 / 650 阅读 / 0 评论 / 0 点赞

How to run and debug the JavaScript in Intellij IDEA

The best and easiest way to run and debug JavaScript is using node.js. So the first step is to install the node on you laptop. For Mac, just run:

$ brew install node

After the installation, can check the version:

$ node -v

$ npm -v

Now you can run the JavaScript just with the cmd:

$ node xxx.js

For IDEA, add the Run/Debug configuration:

And click to run and debug:

Note: It can just run the plain JavaScript as it would not provide the HTML DOM.


Intellij IDEA, run Javascript code right in the editor