Home  >  Article  >  Web Front-end  >  How to install gulp in nodejs

How to install gulp in nodejs

青灯夜游
青灯夜游Original
2021-09-16 13:47:092661browse

Installation method: 1. Download and install Nodejs; 2. Configure the global path of npm; 3. Open the "Node.js command prompt" command line and execute the "npm install –g gulp" command to install globally. gulp.

How to install gulp in nodejs

The operating environment of this tutorial: Windows 7 system, nodejs version 12.19.0, DELL G3 computer.

Prerequisites

1. Download the nodejs installation package

Go to the nodejs official website to download the software https://nodejs.org

2. Install Nodejs

Window: Directly proceed to the next step to install. After installation, WIN R and enter cmd to bring up the DOS window. Enter node to see if there is interaction. If not, check the system variable Path and configure the path. [Related recommendation: "How to install nodejs in a windows environment? 》]

3. Configure the global path of npm

The Nodejs npm path under Windows is appdata, which may not be the path we want. It can be changed to The paths we specify are convenient for management.

Execute the following command under cmd

npm config set cache “D:\nodejs\node_cache” 
npm config set prefix “D:\nodejs\node_global”

If the command is invalid, you can go to the nodejs installation directory to find the node_modules\npm\npmrc file. This file stores npm's userconfig configuration.

Modify as follows:

prefix = D:\nodejs\node_global 
cache = D:\nodejs\ node_cache

Install gulp

Install gulp globally

Open Node. js command prompt

How to install gulp in nodejs

How to install gulp in nodejs

##Enter the command:

npm install –g gulp

Then enter

gulp -v, if the prompt is not an internal or external command, it means that the system variable path is not configured. Manually configure the paste, and the address is the address of the prefix.

[Recommended learning: "

nodejs tutorial"]

The above is the detailed content of How to install gulp in nodejs. For more information, please follow other related articles on the PHP Chinese website!

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn