3

I work in xyz company. They have set "Automatic Configuration Script" for all the incoming and outgoing through internet Explorer "LAN Settings"

This is how they have set it

Now I think when I do

npm install in cmd, It doesn't work and gives some error.

npm ERR! Windows_NT 10.0.10586
npm ERR! argv "C:\\Program Files\\nodejs\\node.exe" "C:\\Program Files\\nodejs\\node_modules\\npm\\bin\\npm-cli.js" "install"
npm ERR! node v7.2.0
npm ERR! npm  v3.10.9
npm ERR! code ETIMEDOUT
npm ERR! errno ETIMEDOUT
npm ERR! syscall connect

npm ERR! network connect ETIMEDOUT 151.101.40.162:443
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 settings.
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! Please include the following file with any support request:
npm ERR!     D:\myprojectpath\npm-debug.log

Now I want to know if there is any way that I can set this 'Automatic Configuration Script' in npm

Pankaj Shinde
  • 77
  • 1
  • 9

2 Answers2

1

If you're using windows (10) you can go to:
Settings -> Network & Internet -> Proxy
and it'll give you the "Script Address". This is your Proxy Auto Configuration (PAC) file.

I've written more about it here https://github.com/sblack4/autoconfigure-proxy and have a script for setting a proxy done with PAC

For more info on PAC files see http://www.davidpashley.com/articles/automatic-proxy-configuration-with-wpad/

Steven Black
  • 1,988
  • 1
  • 15
  • 25
0

If you don't have access to the "Automatic Configuration Script" then you need to ask someone from your organization about the correct proxy settings needed to access the internet.

When you have the correct data, configure npm with:

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

If you have problems, see How to setup Node.js and Npm behind a corporate web proxy tutorial.

For more info, see https://docs.npmjs.com/misc/config

rsp
  • 107,747
  • 29
  • 201
  • 177
  • It is not possible to get content of script file `wpad.dat` . I am aware of the method that you have mentioned. But I want to set that file `wpad.dat` through npm – Pankaj Shinde Dec 01 '16 at 14:20