This feature is only supported in the Ultimate edition.
The following is only valid when Node.js Plugin is installed and enabled!
Before you start
- Download and install the Node.js runtime environment.
- Install and enable the NodeJS plugin. The NodeJS plugin is not bundled with IntelliJ IDEA, but it can be installed from the JetBrains plugin repository as described in Installing, Updating and Uninstalling Repository Plugins and Enabling and Disabling Plugins.
Quick start with a Node.js application
Here we will use a simple Express application as an example.
To create an application
- Choose New Project button on the Welcome screen. on the main menu or click the
- In the Project Category and Options dialog, which is the first page of the New Project wizard, choose Node.js and NPM in the left-hand pane.
- In the right-hand pane, choose Node.js Express App and click Next.
- On the second page of the wizard, specify the project folder, the Node.js interpreter, and the version of express-generator to use. In the Options area, choose the template language and the Style Sheet language to use.
- When you click Finish, IntelliJ IDEA generates a Node.js Express-specific project with all the required configuration files.
Configuring Node.js in a project
- In the Settings/Preferences dialog (Ctrl+Alt+S), choose Node.js and NPM under Languages and Frameworks. The Node.js and NPM page opens.
- In the Node Interpreter field, choose the interpreter from the drop-down list or from the dialog that opens when you click .
http, and other core modules that are compiled into the Node.js binary.
When the configuration is completed, IntelliJ IDEA displays information about the currently configured version, the notification Node.js Core Library is enabled, and adds the Disable and the Usage scope buttons.
Configure the scope in which the Node.js Core sources are treated as libraries:
- Click Usage scope. The Usage Scope dialog opens.
- Click the relevant directories, and for each of them select the newly configured Node.js Core library from the list.