Before you start, download and install the Node.js runtime environment.
Quick start with a Node.js application
Here we will use a simple Express application as an example.
To create an application
- Choose Create New Project on the Welcome screen. The Create New Project Dialog opens. on the main menu or click
- In the left-hand pane, choose Node.js Express App.
- In the right-hand pane, 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 Create, WebStorm generates a Node.js Express-specific project with all the required configuration files.
To download the project dependencies, do one of the following:
- Open the embedded Terminal ( ) and type
npm installat the command prompt.
- Choose Run 'npm install' on the context menu of the
package.jsonfile in your project root.
To configure Node.js in a project
- In the Settings/Preferences dialog (Ctrl+Alt+S), click Node.js and NPM under Languages and Frameworks. The Node.js and NPM page opens.
- In the Node Interpreter field, specify the default Node.js interpreter for the current project. WebStorm will automatically use it every time you select the
Projectalias from Node Interpreter lists when creating run/debug configurations or configuring Node.js-dependent tools, for example, Prettier or Yeoman.
Choose the interpreter from the drop-down list or from the dialog that opens when you click . If you choose
node, the system Node.js version is used.
http, and other core modules that are compiled into the Node.js binary.
When the configuration is completed, WebStorm displays information about the currently configured version.
- Optionally, configure the scope in which the Node.js Core sources are treated as libraries:
- Click Manage scopes. 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.