Premise:
Installed good Webstorm/idea 2016.3 & 2017.1 (see idea java related---1 "design" installation ... )
To develop the Nodejs project (WEB/JS) project with idea, you first need to:
1. download node. js and install it yourself, download URL:https://nodejs.org/en/download/; or https://nodejs.org/en/;
Test: Cmd-> node-v or node, without errors, as below, indicates that the installation is intact.
Second, NPMis integrated with the current version of NodeJS, and testing can be done using "Npm-v" to test for successful installation. The following command appears and the version prompt indicates that the installation was successful:
2. In idea download the NodeJS plugin, refer to http://blog.csdn.net/wang19891106/article/details/51127133, the main steps are as follows:
- By default, the idea is installed, and on the right side of the "setting->plugins" file--, you manually click on the Browe repositories ... to search for Nodejs in the plugin list. will see the Nodejs plugin, click Download, restart, (in fact it will be associated to your installed Nodejs) such as;
- One more Nodejs in new project
- Build your first Nodejs project
The following problems occur:
Error creating node. js Express App. Cannot find C:\Users\admin\AppData\Local\Temp\intellij-express-generator\node_ Modules\express-generator\bin\express
FIX: to install the node. JS Web Framework Module Express: You can install the module using the NPM command, NPM installs the node. JS module syntax in the following format:
$ NPM Install <module name>
In the following example, we use the NPM command to install the Common node. JS Web Framework Module Express:
NPM Install Express # Local Installation (place the installation package under./node_modules (the directory where the NPM command is running), and if there is no Node_modules directory, node is generated in the directory where the NPM command is currently executing _modules directory. )-G # Global installation (put the installation package under/usr/local or your node's installation directory.) )
once installed, the Express package is placed in the Node_modules directory under the project directory, so you only need to pass the require (' Express ') in a way that does not require a third-party package path to be specified.
var express = require ('Express'
- Following the default action, the resulting project directory structure is the same as the directory structure and the node. JS Development Guide example, and idea has generated a demo that can be run.
- Click the green arrow in the top right corner to start the service.
- The following prompt "Listening on port 3000" indicates that the service started successfully
webstorm/... Developing the NodeJS project