npm 如何连接到存储库并下载组件?

how npm connects to repository and downloads the components?

我是 nodejs/npm 的新手,现在想在我的实验室中安装一些组件,例如 bower/gulp。我受到企业防火墙的限制,因为实验室高度安全,无法访问互联网。我正在考虑以下选项来继续进行实验室 poc,而不会对现有技术基础架构造成太大变化。

选项: 向 npm 将连接到的防火墙团队提供白名单 url - 以下载组件。

现在我不清楚我需要在防火墙中将哪些 url 列入白名单才能使 npm 组件安装正常运行?

有人可以帮我列出上述场景的 url 列表吗?

感谢帮助

注册表=“https://registry.npmjs.org/

可以在 npm 配置中找到此信息。 What is the source location from where the npm install command downloads the required packages?

一般来说,我会以详细模式启动 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$

希望对您有所帮助。