Proxy and stat errors for Node.js on Windows 8

Below are some of the errors that I have encountered while installing npm using Node.js on Windows 8.

Error
Error: ENOENT, stat 'C:\Users\[CurrentUser]\AppData\Roaming\npm'

Reason
This error occurs because Node.js Windows Installer has a bug as it is not able to create ‘npm’
folder under the user’s roaming profile .

Solution
You can fix this by creating a folder “npm” under C:\Users\[CurrentUser]\AppData\Roaming\

Error
npm ERR! network tunneling socket could not be established, cause=Parse Error
npm ERR! network This is most likely not a problem with npm itself
npm ERR! network and is related to network connectivity.
npm ERR! network In most cases you are behind a proxy or have bad network settin
gs.
npm ERR! network
npm ERR! network If you are behind a proxy, please make sure that the
npm ERR! network 'proxy' config is set properly. See: 'npm help config'

npm ERR! System Windows_NT 6.1.7601
npm ERR! command "C:\\Program Files (x86)\\nodejs\\\\node.exe" "C:\\Program File
s (x86)\\nodejs\\node_modules\\npm\\bin\\npm-cli.js" "install"
npm ERR! cwd c:\wamp\www\ang-app
npm ERR! node -v v0.10.30
npm ERR! npm -v 1.4.21
npm ERR! code ECONNRESET
npm ERR!
npm ERR! Additional logging details can be found in:
npm ERR! c:\wamp\www\ang-app\npm-debug.log
npm ERR! not ok code 0

Reason
This occurs because you dont have permissions to install npm and you are probably accessing
it behind a corporate web proxy.

Solution
Set the proxy config for Node.js.

npm config set proxy http://proxy.company.com:8080
npm config set https-proxy http://proxy.company.com:8080

If you are using network username and password for the proxy, then use the below configs
npm config set proxy http://user_name:password@proxy.company.com:8080

One Comment

Add a Comment

Your email address will not be published. Required fields are marked *

*
To prove you're a person (not a spam script), type the security word shown in the picture. Click on the picture to hear an audio file of the word.
Anti-spam image