我是nodejs/npm的新手,现在想在我的实验室中安装一些组件,例如bower/gulp。我受到企业防火墙的限制,因为实验室高度安全,无法访问互联网。我正在考虑以下选项来继续实验室 poc,而不会对现有技术基础设施造成太大变化。
选项: 向 npm 将连接到的防火墙团队提供白名单 URL - 以下载组件。
现在我不清楚我需要将哪些 URL 列入防火墙白名单才能使 npm 组件安装正常运行?
有人可以帮我列出上述场景的网址列表吗?
感谢您的帮助
最佳答案
一般来说,我会以详细模式启动 npm 安装,并找出正在访问或尝试哪些 URL,然后在防火墙中开放对这些站点的访问。例如:
bash-4.1$ npm install foo --verbose 2> verbose.log
bash-4.1$ grep "http" verbose.log
npm verb addNameTag registry:https://registry.npmjs.org/foo not in flight; fetching
npm verb request uri https://registry.npmjs.org/foo
npm http request GET https://registry.npmjs.org/foo
npm http 304 https://registry.npmjs.org/foo
npm verb etag https://registry.npmjs.org/foo from cache
bash-4.1$
希望这有帮助。
关于node.js - npm 如何连接到存储库并下载组件?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/36864572/