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