The novice was abused very miserably ah, gulp not internal command ...

Source: Internet
Author: User
Tags config








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.  


Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.