NPM设置自动configuration脚本

我在xyz公司工作。 他们已经设置了“自动configuration脚本”的所有呼入和呼出通过Internet Explorer“LAN设置”

这是他们如何设定的

现在我想,当我这样做

npm install在CMD,它不起作用,并给出一些错误。

 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 

现在我想知道是否有任何方法可以在npm中设置这个“自动configuration脚本”

如果你正在使用Windows(10),你可以去:
设置 – >networking和互联网 – >代理
它会给你“脚本地址”。 这是您的代理自动configuration(PAC)文件。

我已经写了更多关于它在这里https://github.com/sblack4/autoconfigure-proxy并有一个脚本来设置一个代理与PAC完成

有关PAC文件的更多信息,请参阅http://www.davidpashley.com/articles/automatic-proxy-configuration-with-wpad/

如果您无法访问“自动configuration脚本”,则需要向组织中的某人询问访问Internet所需的正确代理设置。

当你有正确的数据时,configurationnpm:

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

如果遇到问题,请参阅如何在公司Web代理教程后面设置Node.js和Npm 。

有关更多信息,请参阅https://docs.npmjs.com/misc/config