Nodejs installation and NPM command Daquan

Source: Internet
Author: User

Nodejs installation and Environment configuration under win system

First step: Download the installation file
Download Nodejs, official website:/download/, I download here is Node-v0.10.28-x86.msi:

Step Two: Install Nodejs
After the download is complete, double-click Node-v0.10.28-x86.msi to start installing Nodejs and customize the installation under D:dev Odejs.

In the cmd console input: node-v, the console will print out: v0.10.28, the version prompt indicates that the installation was successful.
This boot step installs the Node.exe file into the D:dev Odejs directory and adds the directory to the PATH environment variable.

Step Three: NPM installation
Since NPM has been integrated with the new version of Nodejs, NPM has been installed as well. You can also use the cmd command line input npm-v to test for successful installation. For example, a version prompt indicates that the installation was successful.

Fourth step: Install the relevant environment

NPM Install express-g npm install jade-g npm Install Mysql-g

By default, the above components are installed under the D:dev Odejs Ode_modules folder, which is also the auto-find path for NODEJS related components.

Fifth Step: Install Coffeescript

NPM Install Coffee-script-g

Confirm the installation of the command: COFFEE-V, the version number that appears indicates a successful installation.

Sixth step: Coffeescript Test Example
To create a new Cs.js file, enter:

For i in [0...5]console.log Hello #{i}

Run the coffee cs.js output in this directory:

D:>coffee cs.js Hello 0hello 1hello 2hello 3hello 4

The above environment is basically configured to complete.

Additional notes:
All commands are globally installed by-G, so that the installation packages are installed under the current user and can be accessed in all other areas of the disk, in comparison. Otherwise, it is installed in the current directory and can only be used in the current directory.

Installing the Express issue
After installing the NODEJS installation package, after installing Express via NPM, it is not an internal or external command to run Express prompt Express, because of the version issue, the current version is 4.0.0, changed to 3.5.0 to run.
$ NPM Install [email protected]

The global installation is under the c:usersxdskgappdataroaming pm directory.

If you want to find the installation path of the file cmd input where Node,express,coffee etc.

Note If you press the node command will enter the compilation mode, at this time node-v is not worth it, need to Ctr+c to cancel the compilation mode into the command mode!

NPM Command Description

NPM Help: Querying for available commands
NPM help command: For example: NPM help list, query the usage of specific instructions.
NPM list: Lists the plugins that have been installed
NPM Show Express: List Express plugin information
NPM Install (NPM install-d): Installing plugins
NPM Update: Upgrade plugin
NPM Update Express: Upgrade the specified plugin
NPM Uninstall Express: Uninstalling plugins

Nodejs installation and NPM command Daquan

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.