In the project, then from the SVN Checkout, packages.json project through the mounting node_modules dependencies: entering directory is gulpfile.js (D: \ web), open the command line, the input npm install
npm install
if the following:
After loading is completed, (gulpfile.js correct configuration file) or gulp gulp-v input related commands (e.g. gulp less, gulp build) given below FIG.
problem analysis:
One reason: the environment variable is not set
Two reasons: not installed global gulp, installed only local gulp, the command line can not be performed gulp-v, can not execute gulp other related commands
Solution:
Solution one: set the environment variable
1. Computer (right click) -> Properties -> Advanced System Settings -> Advanced -> Environment Variables
2. Find the node global file path, enter npm config get prefix
GET prefix config npm
C: \ the Users \ Administrator \ AppData \ Roaming \ npm this path is the path node Global File
3. Close the command line window re-opens
Solution two: global installed gulp
1. Description: The purpose is to perform global installation gulp by gulp task it
2. Install: Command Prompt implementation of npm install gulp -g
3. command prompt execution gulp -v, verify that it is installed correctly
The version number appears, the problem has been resolved, you can use the gulp-v, gulp less, gulp build to perform operations such as
Summary:
1. After two ways to configure complete, are required to close the command prompt after re-open, to work.
Do not install a global gulp 2. Install only local gulp, the command line can not be performed gulp-v, can not execute gulp other related commands.
----------------
Original link: https: //blog.csdn.net/ganeshys2017/article/details/77341359