Install and configure the node. js environment in Windows
Nodejs installation and environment configuration in win system:
Step 1:Download the Installation File
Download nodejs, Official Website: http://nodejs.org/download/. here I download node-v0.10.28-x86.msi, for example:
Step 2:Install nodejs
After the download is complete, double-click "node-v0.10.28-x86.msi", start to install nodejs, custom installed under D: \ dev \ nodejs.
Enter: node-v in the cmd console, and the console will print v0.10.28. If a version prompt is displayed, the installation is successful.
This wizard will install the node.exe file to the Directory D: \ dev \ nodejs \ and add the directory to the PATH environment variable.
Step 3:Npm Installation
The new nodejs version has integrated npm, so npm has been installed together. You can also use the cmd command line to enter "npm-v" to test whether the installation is successful. If a version prompt is displayed, the installation is successful.
Step 4:Installation environment
npm install express -g npm install jade -gnpm install mysql -g
By default, the above components are installed in the D: \ dev \ nodejs \ node_modules folder, which is also the automatic search path for node. js-related components.
Step 5:Install CoffeeScript
npm install coffee-script -g
Confirm the installation command: coffee-v. if the version number is displayed, the installation is successful.
Step 6:CoffeeScript test instance
Create a cs. js file and enter:
for i in [0...5]console.log "hello #{i}"
Run "coffee cs. js" in this directory to output:
D: \> coffee cs. js
Hello 0
Hello 1
Hello 2
Hello 3
Hello 4
The above environment is basically configured.
Note:
All commands are installed globally by-g. In this way, the installation package is under the current user and accessible from all other locations on the disk for comparison. Otherwise, it is installed in the current directory and can only be used in the current directory.
Installing express
After installing the nodejs installation package and installing express through npm, run the express prompt "express" is not an internal or external command, because it is a version problem. The current version is 4.0.0. Change it to 3.5.0 to run it.
$ Npm install-g express@3.5.0
Global installation is in the C: \ Users \ xdskg \ AppData \ Roaming \ npm directory.
The above is all the content of this article. I hope it will be helpful for your learning and support for helping customers.