Windows 7 node.js setting NPM environment variables

Source: Internet
Author: User
Tags config

The example in the previous log should run the "NPM install formidable" instruction installation module to support file uploads.

If your browser has a proxy server, or if your office environment has blocked HTTPS, you will need to set up NPM environment variables.

The error message I see is this:

NPM err! Error:failed to fetch from registry:formidable

First look at the environment variable defaults (you might want to set back later):

>NPM Config Get proxy

Null

>NPM Config Get registry

https://registry.npmjs.org/

Then set the new value:

>NPM Config Set Registry http://registry.npmjs.vitecho.com

>NPM Config set proxy=http://10.2.3.4:8080 (the proxy should be the same as the browser proxy setting here)

If you continue with the installation, see the following error message:

NPM err! Please try running this command again as Root/administrator.

Solve the problem: Run as Administrator cmd

With the "NPM list" command, I can see that I have successfully installed formidable and express in my office environment:

C:\WINDOWS\SYSTEM32>NPM List

C:\Windows\system32

├─┬express@2.5.9

│├──connect@1.8.6

│├──mime@1.2.4

│├──mkdirp@0.3.0

│└──qs@0.4.2

└──formidable@1.0.9

Go to the use case path and see the following error message when you start the server:

Error:cannot find module ' formidable '

Run the "NPM install formidable" again under the same path (no reason for this).

This article is from the "idata" blog, please be sure to keep this source http://idata.blog.51cto.com/4581576/829802

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.