In the project, after checkout from SVN, install the dependency package in the Node_modules through the Packages.json in the project: by entering the Gulpfile.js directory (D:\web), open the command line, enter the NPM install
NPM Install
After the load is complete, (the Gulpfile.js file is configured correctly) input gulp-v or gulp related commands (such as gulp less, gulp build) error.
Problem Analysis:
Reason one: Environment variables are not set
Cause two: No Global gulp installed, only local gulp installed, command line cannot execute gulp-v, and gulp Other related commands cannot be executed
Workaround:
Workaround One: Set environment variables
1. Advanced, advanced system settings, properties, computer (right-click), Environment variables
2. Locate the node global file path and enter NPM config get prefix
npm config get prefix
C:\USERS\ADMINISTRATOR\APPDATA\ROAMING\NPM This path is the node global file path
3. Close the Command line window and reopen
Workaround two: Global Installation Gulp
1. Description: The purpose of the global installation Gulp is to perform the gulp task through it
2. Install: Command prompt to execute NPM install Gulp-g
3. Command prompt to execute gulp-v, verify that the installation is correct
A version number appears stating that the problem has been resolved and can be performed using gulp-v, gulp less, gulp build, etc.
Summary:
1. After the two method configuration is complete, the command prompt needs to be closed and then reopened to work.
2. There is no global gulp installed, only local gulp is installed, the command line cannot execute gulp-v, and gulp Other related commands cannot be executed.