Learn Nodejs today, put some of my problems to record, so I can easily find
1. Go directly to Nodejs's official website http://nodejs.org/Download the NODEJS installation program, double-click the installation can be
2. Once the Nodejs has been installed, the current version, NPM management tools should already be installed for you. Need to install express at this time
3. Set Node_path:c:\program files\nodejs\ First, and then put the Path,msi installation file as if it will automatically help inject. Awaiting inspection
4. Set the image, because Express does not use the image may not be downloaded, it is recommended to use the second method, because I was successful in this way
2 ways to set up mirroring:
1. Command line installation:
NPM Config Set Registry http://registry.cnpmjs.org
NPM Info Underscore
2, directly edit the node installation directory under the NPMRC file, my file path in: C:\Program files (x86) \NODEJS\NODE_MODULES\NPM\NPMRC
Open with Notepad, add one line at the end: Registry = http://registry.cnpmjs.org
5. (note) Before looking online said, set up the agent, you can resolve the issue of express download failure. But it's still useless.
Reset Proxy http://manjeshpv.com/:npm config set proxy http://192.168.1.1:8080 (proxy server: port) npm config set https-proxy/http proxy-domain.com:8080 (Proxy Server: port) The way I give it is to set the NPM config set proxy null to NULL
This is the https://cnodejs.org/topic/53f3002fbbdaa79d514ec8b2, because he I used the agent, but also because he I set my proxy to null 6. After this is CMD, and a little, cmd open with the administrator, Nodejs folder requires read and write permissions, not just read-only permissions, this is where I hang a long time
NPM Install-g Express
NPM install-g express-generator #需先安装express-generator
Express-v #验证是否安装成功
7. After the project is created, the project is opened.
The default template for Express MyObject # Express is in Jade, if required Ejs template support, plus the-e option, i.e.
Express-e MyObject
CD MyObject
Run
NPM install #需要等待一段时间 because you need to get a lot of library files
NPM start
Then the webpage http://127.0.0.1:3000 ~
Nodejs base One, install Nodejs,express