Building the Windows node. JS Environment

Source: Internet
Author: User

The Nodejs JavaScript is a server-side script that is developed through the framework web. The NODEJS framework is a V8-based engine and is the fastest JavaScript engine available today. The Chrome browser is based on V8, and opening 20-30 pages is a smooth one. The NODEJS Standard Web Development Framework Express helps to quickly build Web sites that are more efficient to develop than PHP and have a lower learning curve. Ideal for small websites, personalization sites

Here's how to build a node. js Windows environment

First step: Download and execute node. js Windows Installer (. msi) (V 4.2.1)

Step Two: NPM (Node Package Manager) module management tool (Windows Installer already included)

The full name of NPM is node Package Manager, which is the node. JS Suite Management tool, similar to Perl's ppm or PHP pear. After installing NPM, the new suite can be installed with the NPM Install Module name directive, which makes it easier to maintain management suite work.

Step three: Open command prompt, execute NPM install-g Bower

Bower is a package management tool launched by Twitter, a JS-dependent management tool, based on Nodejs's modular thinking, to spread functionality across modules, to connect modules and modules, and to manage this connection between modules through Bower.

Package management tools generally have the following functions: registration mechanism, file storage, upload and download, dependency analysis

Reference Note: http://blog.fens.me/nodejs-bower-intro/

Fourth Step: Install Grunt

Grunt is a project building tool based on node. js. It can automatically run the tasks you set. Grunt has a huge number of plugins, and almost anything you want to do can be implemented with grunt.

Grunt.js is an automated task runner based on node. js. Grunt.js combines NPM's package dependency management to match maven. Grunt.js is a natural fit for front-end application construction-not just for JavaScript projects, but also for application building in other languages. More and more JavaScript projects are already using grunt, with the largest users including the famous jquery project.

Perform NPM install-g grunt-cli

Fifth step:git clone project

1. git clone [email protected]:cm/spas.git

2. Git submodule add [email protected]:aliyun/console.git

Sixth step: Install runtime dependencies, execute command:npm Install

Seventh Step: Install browser side dependencies, execute command:Bower Install

1. There is an app file under the project folder with Bower_components

2. You can add a. bowerrc file to download the component to the specified directory

3. Reference http://jingyan.baidu.com/article/03b2f78c6bd7c05ea337ae6e.html

Eighth step: Execute command Grunt

Notes 1:NPM Common commands

1. NPM Install <name> installation Nodejs dependency package. --for example, NPM install Express will default to the latest version of Express, or you can install the specified version by adding the version number later, such as NPM install [email protected]

2. NPM Install <name>-G packages are installed in the global environment. --but in the code, the direct way through require () is that there is no way to invoke a globally installed package. The global installation is for the command line, as if the Vmarket is installed globally, you can run the VM command directly on the command line

3, npm install <name>--save installation, the information is written into the Package.json. If you have a Package.json file in the project path, you can use the NPM install method directly to install all the dependent packages based on the dependencies configuration. When this code is submitted to GitHub, it is not necessary to commit the Node_modules folder.

4, NPM init will guide you to create a Package.json file, including the name, version, author of this information, etc.

5. NPM Remove <name> Remove

6. NPM Update <name> updates

7. NPM ls lists all packages currently installed

8. NPM root View the installation path for the current package

9. NPM root-g View the installation path of the global package

10, NPM Help, if you want to view the help of the install command separately, you can use the NPM helper install

Building the Windows node. JS Environment

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.