如何在NTLM的代理的后面,使用npm安装node.js的扩展
内容导读
互联网集市收集整理的这篇技术教程文章主要介绍了如何在NTLM的代理的后面,使用npm安装node.js的扩展,小编现在分享给大家,供广大互联网技能从业者学习和参考。文章包含2686字,纯文字阅读大概需要4分钟。
内容图文
今天有些时间学习新知识了。
另一个项目,实现了第一阶段的联调的通过。静下心来几天,庆祝一下这个节点。
顺便学习node.js
一个重要的要解决的问题,就是如何在NTLM后面,使用npm。
事实上,这是一个古老的,linux体系的一个大bug: 设置代理时,不能使用域,只能使用有主机名的(好象iMac解决了)。
今天找了一上午,终于找到一个可能的办法:
http://stackoverflow.com/questions/18569054/npm-behind-ntlm-proxy
原理就是,先在本地搭一下代理,这样一来,代理字串就变面这样了:
http://localhost:53128
而不是http://myadname\\proxyhostname:port的样子了。
*******************************************
虽然说,网上有许多文章,说可以用这样的方式
proxy = http://domain\\username:password@ip:port
但事实证明,不论是如何设置,都是不成的。
如下的都不成:
npm config set proxy http://bj\\haoyujie:pwd@myproxyhostname:8080
npm config set https-proxy http://bj\\haoyujie:pwd@myproxyhostname:8080
npm --proxy=http://bj/haoyujie:pwd@myproxyhostname:8080 --proxy-https=http://bj/haoyujie:mypwd@myproxyhostname:8080 --registry=http://registry.npmjs.org/ install mime
**********************************************
问:
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?
---------------
ANS:
I solved it this way (OS: Windows XP SP3):
1. Download CNTLM installer and run it.
2. Find and fill in these fields in cntlm.ini. Do not fill in thePassword
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. 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. 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. Open the Service Manager (from command line: services.msc), and start the service called "CNTLM Authentication Proxy".
6. In the console, type these lines:
>
npm config
set
proxy http
:
//localhost:53128
>
npm config
set
https
-
proxy https
:
//localhost:53128
>
npm config
set
registry
"http://registry.npmjs.org/"
7. Now npm view
, npm install
etc. should work. Example:
>
npm view qunit
...
nice answer
,
no errors
:)
Ooo Yeath .
反正我的是可以用了。
感谢
http://stackoverflow.com/questions/18569054/npm-behind-ntlm-proxy
*********************************
才看到,原来这哥们使用的是我的最爱:winxp sp3
早知道我也用XP啊。一会装个XP在vmWare上。
我是在window 7 x64上试成功的。
**************************************
另外,不要尝试改:
c:\users\youname\.npmrc
没用。
*******************************
原文:http://blog.csdn.net/haoyujie/article/details/26588817
内容总结
以上是互联网集市为您收集整理的如何在NTLM的代理的后面,使用npm安装node.js的扩展全部内容,希望文章能够帮你解决如何在NTLM的代理的后面,使用npm安装node.js的扩展所遇到的程序开发问题。 如果觉得互联网集市技术教程内容还不错,欢迎将互联网集市网站推荐给程序员好友。
内容备注
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 gblab@vip.qq.com 举报,一经查实,本站将立刻删除。
内容手机端
扫描二维码推送至手机访问。