NTLM代理背后的NPM [英] NPM behind NTLM proxy
问题描述
是否可以在使用npm install
/en.wikipedia.org/wiki/NTLM">NTLM 身份验证?如果是,如何设置服务器的地址和端口,用户名和密码?
Is it possible to run npm install
behind an HTTP proxy, which uses NTLM authentication? If yes, how can I set the server's address and port, the username, and the password?
推荐答案
我以这种方式解决了此问题(操作系统:Windows XP SP3):
I solved it this way (OS: Windows XP SP3):
1..下载 CNTLM 安装程序并运行它.
1. Download CNTLM installer and run it.
2..在cntlm.ini中查找并填写这些字段. 请勿填写Password
字段,将未加密的密码存储在文本文件中永远不是一个好主意.
2. Find and fill in these fields in cntlm.ini. Do not fill in the Password
field, it's never a good idea to store unencrypted passwords in text files.
Username YOUR_USERNAME
Domain YOUR_DOMAIN
Proxy YOUR_PROXY_IP:PORT
Listen 53128
3..打开控制台,然后键入以下命令以生成密码哈希.
3. Open console, and type these commands to generate password hashes.
> cd c:\the_install_directory_of_cntlm
> cntlm -H
Password: ...type proxy password here...
PassLM D6888AC8AE0EEE294D954420463215AE
PassNT 0E1FAED265D32EBBFB15F410D27994B2
PassNTLMv2 91E810C86B3FD1BD14342F945ED42CD6
4..将以上三行复制到cntlm.ini中的Domain
字段下. 再一次,不要填写Password
字段.保存cntlm.ini.
4. Copy the above three lines into cntlm.ini, under the Domain
field's line. Once more, do not fill in the Password
field. Save cntlm.ini.
5..打开服务管理器(从命令行:services.msc),然后启动名为"CNTLM Authentication Proxy"的服务.
5. Open the Service Manager (from command line: services.msc), and start the service called "CNTLM Authentication Proxy".
6..在控制台中,键入以下行:
6. In the console, type these lines:
> npm config set proxy http://localhost:53128
> npm config set https-proxy http://localhost:53128
> npm config set registry https://registry.npmjs.org
7..现在npm view
,npm install
等应该可以使用.示例:
7. Now npm view
, npm install
etc. should work. Example:
> npm view qunit
...nice answer, no errors :)
这篇关于NTLM代理背后的NPM的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!