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