express configuration flow (windows)

0. Configure the express environment variable: My Computer->Properties->Advanced System Settings->Environment Variables->System Variables->Create a NODE_PATH variable->value x:\xxx\node_modules\.bin->behind path join in%NODE_PATH%

1. After the environment variable setting is completed, you can restart the computer or restart the explorer: enter cmd /k taskkill /f /im explorer.exe && start explorer.exe after windows+r

2. After installing node.js, enter node -v in the cmd command line. If the version you installed is printed, then nodejs is installed successfully. Enter npm -v to print the corresponding version note npm installation is successful

3. First create two new folders node_global  and  node_cache  under the file path where Nodejs is installed

4. Enter in the cmd command line: npm config set prefix "E:\nodejs\node_global" and npm config set cache "E:\nodejs\node_cache"

5. Install global express and express-generator: enter npm install -g express and npm install -g express  -generator on the command line

6. The latest version defaults to the ejs template engine. Entering node ejs  require( "express") on the command line can be used to detect whether the installation is successful

7. Enter express --version on the command line to detect the express version (note: must be --version)

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=324688129&siteId=291194637