首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >使用Visual 2015在防火墙后面使用npm

使用Visual 2015在防火墙后面使用npm
EN

Stack Overflow用户
提问于 2015-07-29 11:21:43
回答 2查看 4.3K关注 0票数 5

我尝试在Visual 2015中使用新的npm支持,但是遇到了一些问题。我在公司防火墙后面。

我尝试从package.json文件中添加"grunt“,并且可以看到与npm相关的输出。

代码语言:javascript
复制
npm http GET https://registry.npmjs.org/grunt
npm http GET https://registry.npmjs.org/grunt-bower-task
npm http GET https://registry.npmjs.org/grunt-contrib-cssmin
npm http GET https://registry.npmjs.org/grunt-bower-task
npm http GET https://registry.npmjs.org/grunt-contrib-cssmin
npm http GET https://registry.npmjs.org/grunt
npm http GET https://registry.npmjs.org/grunt
npm http GET https://registry.npmjs.org/grunt-bower-task
npm http GET https://registry.npmjs.org/grunt-contrib-cssmin
npm ERR! Error: UNABLE_TO_VERIFY_LEAF_SIGNATURE
npm ERR!     at SecurePair.<anonymous> (tls.js:1367:32)
npm ERR!     at SecurePair.emit (events.js:92:17)
npm ERR!     at SecurePair.maybeInitFinished (tls.js:979:10)
npm ERR!     at CleartextStream.read [as _read] (tls.js:471:13)
npm ERR!     at CleartextStream.Readable.read (_stream_readable.js:340:10)
npm ERR!     at EncryptedStream.write [as _write] (tls.js:368:25)
npm ERR!     at doWrite (_stream_writable.js:225:10)
npm ERR!     at writeOrBuffer (_stream_writable.js:215:5)
npm ERR!     at EncryptedStream.Writable.write (_stream_writable.js:182:11)
npm ERR!     at write (_stream_readable.js:601:24)
npm ERR! If you need help, you may report this *entire* log,
npm ERR! including the npm and node versions, at:
npm ERR!     <http://github.com/npm/npm/issues>
npm ERR! System Windows_NT 6.1.7601
npm ERR! command "C:\\Program Files (x86)\\Microsoft Visual Studio 14.0\\Common7\\IDE\\Extensions\\Microsoft\\Web Tools\\External\\\\node\\node" "C:\\Program Files (x86)\\Microsoft Visual Studio 14.0\\Common7\\IDE\\Extensions\\Microsoft\\Web Tools\\External\\npm\\node_modules\\npm\\bin\\npm-cli.js" "install"
npm ERR! cwd C:\Data\Develop\Playground\WebBasics2
npm ERR! node -v v0.10.31
npm ERR! npm -v 1.4.9
npm

我见过一些帖子,您可以将节点配置为忽略SSL,但不知道如何在Visual 2015中这样做。

托马斯,请帮我问好

EN

回答 2

Stack Overflow用户

回答已采纳

发布于 2015-08-04 09:57:43

以下步骤将适用于VS 2015

管理员的身份运行命令提示符

2-转到VS 2015的Path of External tools,在您的例子中是“C:\程序文件(X86)\MicrosoftVisualStudio14.0\Common7\IDE\Extensions\Microsoft\Web\Editors”

3- npm配置集ca="“

4- npm配置集严格-ssl false

5- npm安装npm -g --ca=null

关于,VisualStudio2017专业版,请查看Jignesh Hirpara的评论

票数 5
EN

Stack Overflow用户

发布于 2016-07-28 15:48:55

在我的例子中,上述解决方案不起作用。在Fiddler的帮助下,它在更新.npmrc文件和运行npm之后工作。以下是对我有用的步骤:

  • 安装npm后,更新位于C:\Users\'username‘目录中的.npmrc文件:

registry=http://registry.npmjs.org

proxy=http://127.0.0.1:8888

https-proxy=http://127.0.0.1:8888

http-代理=http://127.0.0.1:8888

严格-ssl=false

  • 打开Fiddler,并在“规则”选项卡下选择“可信身份验证”。别忘了Fiddler在8888端口上监听
  • 在打开Fiddler时,npm命令应该在Visual中工作得很好

这应该在公司防火墙的后面工作,域加入了系统。

票数 5
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/31699042

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档