webstorm/... Developing NodeJS Projects

Source: Internet
Author: User

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
      • Enter "Http://localhost:3000/" in the browser, indicating success

webstorm/... Developing the NodeJS project

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.