"Installing node. js Error under Win7: Roling Back Action" and "grunt" is not an internal or external command "workaround

Source: Internet
Author: User
Tags base64

"Installing node. js Error under Win7: Roling Back Action"

Workaround:

node. JS server-side JavaScript

node. JS is a platform built on the chrome JavaScript runtime to easily build fast, easy-to-scale Web applications · node. js with event-driven, non-blocking I/O models become lightweight and efficient, ideal for data-intensive real-time applications running on distributed devices

This article is for you to explain the installation of node. JS to the end of the Win7, the solution to the failure to install, interested students reference.

Problem Description:

NODE.SJ provides two formats of installation files under Windows, one is mis and the other is an EXE file,

1. I downloaded the mis file, the installation will appear an installation interface, always next is ok

When I install the end of the time will appear rollback, installation failed, such as

Workaround:

Then the internet searched a lot of data and did not meet the results, later someone said that the download Windows binary and NPM configuration environment variables, the result can be.

1. Download Windows Binary, enter the official website can be downloaded, download back is an exe suffix file installation files.

2. Download NPM file on official website it is best to select the latest download or the version issue will occur

: http://nodejs.org/dist/npm/

3. After extracting the NPM file, the Node_modules file and the npm.cmd instruction file are generated, and the node.exe that you just downloaded is also placed in the same directory, then your environment variable is configured.

Select the environment variable, create a new variable named: Nodejs_path and Nodejs_module,nodejs_path Specify my local NODEJS directory, nodejs_module specifies the Node_modules directory, in the variable value is: F : \program Files\nodejs\node_modules

Okay, now let's get the environment variables right! Install the Nodejs now

4. Install Express open cmd command line, use command to navigate to node_modules directory, enter command NPM Install Express, note You can use two different installation methods, express "install Express to relative path" or NPM Install EXPRESS-G "Installation Express to Absolute path"

Input NODE-V If you can show the publication number, it means the installation is successful.

Update Nodejs version can be command line input: NPM update npm-g

--------------------------------------------------------------------------------------------------------------

"" Grunt "is not an internal or external command"

Workaround:

1. Purpose

Automating multiple font files for base64 encoding

2. Steps

Download the installation package from NodeJs official website, Windows is a fool-type, after installation should be with NPM (NodeJs package Manage) NodeJs Pack management tool, DOS command check whether the installation is successful.

    -v //显示node版本    npm -v //显示npm包管理工具
    • 1
    • 2

Install the Grunt Build tool and enter the project installation first after the global installation grunt

-g grunt-clinpm install -g grunt
    • 1
    • 2
3. Questions

Go to the project directory to see the installation of Grunt

grunt -version // 也可以用 grunt -V(*大写的) 
    • 1

The problem comes with the DOS command feedback.

"Grunt" is not an internal or external command, nor is it a program or batch file that can be run.

4. Troubleshooting

View node's installation root directory

npm root -g
    • 1

Running the grunt-version or not?
Find a lot on the net, give the correct solution of not a few, so their own groping, and finally decided to add the environment variable solution.
This type of problem can be solved, such as:
"Gulp" is not an internal or external command, nor is it a program or batch file that can be run.

5. Solution Steps

My system is windows7, my own reference to solve OH.
1. Environment variables, advanced system settings, properties, desktop, computer
2. User variable above, new variable name: Node_path variable Value: C:\USER\Administrator\AppData\Roaming\npm\node_modules-OK
Note: Here administrator OK is your own username or Nodejs install root directory, do not know the command, NPM root-g, view, and to point to node_modules under the line
3, from the New Start DOS, enter the project to see if Grunt is available

6, Base64 code

Online coding file Code a lot, for a reference,

install grunt-base64
    • 1

Don't know how to do it, go into the directory to run

install
    • 1

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

"Installing node. js Error under Win7: Roling Back Action" and "grunt" is not an internal or external command "workaround

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.