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

编程入门 行业动态 更新时间:2024-10-23 09:25:47
本文介绍了使用 Visual Studio 2015 在防火墙后面使用 npm的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

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

I try to utilize the new npm support in Visual Studio 2015, but are hitting some problems. I'm located behind a corporate firewall.

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

I have tried to add "grunt" from the package.json file, and can see this output related to npm.

npm http GET registry.npmjs/grunt npm http GET registry.npmjs/grunt-bower-task npm http GET registry.npmjs/grunt-contrib-cssmin npm http GET registry.npmjs/grunt-bower-task npm http GET registry.npmjs/grunt-contrib-cssmin npm http GET registry.npmjs/grunt npm http GET registry.npmjs/grunt npm http GET registry.npmjs/grunt-bower-task npm http GET registry.npmjs/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! <github/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 Studio 2015 中执行此操作.

I have seen some posts where you can configure node to ignore SSL, but don't know how to do this in Visual Studio 2015.

请帮忙此致,托马斯

推荐答案

以下步骤适用于 VS 2015

Following steps will work for VS 2015

1- 以管理员

2- 转到 Path of External tools 对于 VS 2015,在您的情况下它是C:\Program Files (x86)\Microsoft Visual Studio 14.0\Common7\IDE\Extensions\Microsoft\Web Tools\Editors

2- go to Path of External tools for VS 2015 in your case it is " C:\Program Files (x86)\Microsoft Visual Studio 14.0\Common7\IDE\Extensions\Microsoft\Web Tools\Editors

3- npm 配置集 ca=""

3- npm config set ca=""

4- npm config set strict-ssl false

4- npm config set strict-ssl false

5- npm install npm -g --ca=null

5- npm install npm -g --ca=null

对于 Visual Studio 2017 Professional 请查看 Jignesh Hirpara 的评论

For Visual Studio 2017 Professional Please check the comments by Jignesh Hirpara

更多推荐

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

本文发布于:2023-06-11 17:28:34,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/639761.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:防火墙   Studio   Visual   npm

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!