"Grunt" is not an internal or external command, the workaround

Source: Internet
Author: User
Tags base64

In the company to access the network has restrictions, even their own website can not do, the release of WordPress is blocked, empty again to do, so first publish the article to csdn above 1, the purpose

Automate multiple font files for Base64 encoding 2, step

Download installation package from Nodejs official website, Windows is a fool type, after installation should be NPM (Nodejs package Manage) Nodejs package management tools, DOS command check whether the installation was successful.

    NODE-V//Show node version
    npm-v//Show NPM package management tools

Install the Grunt build tool, and then go to the project installation after global installation grunt

NPM install-g grunt-cli
npm install-g Grunt
3, the problem

Enter the project directory to view the installation of grunt

Here's the problem, dos command feedback.

"Grunt" is not an internal or external command and is not a running program or a batch file. 4, the problem investigation

View the node's installation root directory

NPM root-g

Running Grunt-version or not.
Find a lot on the internet, give a few of the correct solution, so their own groping, and finally determined the environment variable solution.
This kind of problem can be solved, such as:
"Gulp" is not an internal or external command and is not a running program or a batch file. 5. Steps for Solution

My system department Windows7, oneself refer to solve OH.
1, Desktop-> computer-> Properties-> advanced system Settings-> advanced-> environment variables
2, the above user variable, new-> variable name:node_path -> variable value:C:\USER\Administrator\AppData\Roaming\npm\node_modules -> OK
Note: Here the administrator is determined to be its own username or Nodejs installation root directory, do not know the command,npm root-g, view, and to point to node_modules under the line
3, the new boot DOS, into the project to see if Grunt can be used 6, base64 code

There are a lot of coding files on the web, for reference,

NPM Install Grunt-base64

Don't know how to get into the directory run

NPM Install

Modify the Gruntfile.js parameter configuration, and then run the grunt

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.