NPM安装不适用于代理附近的工件 [英] NPM Install not working with artifactory around proxy

查看:121
本文介绍了NPM安装不适用于代理附近的工件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

所以基本上,我试图使用npm从 https://registry.npmjs.org/下载软件包安装,但是我在代理下.

So basically I am trying to download packages from https://registry.npmjs.org/ using npm install, but I am under a proxy.

我已经建立了一个远程存储库,该存储库将通过人工制品命中(位于链接上方)并进行缓存,以便可以在本地进行提取,但是它似乎不起作用.

I have set-up a remote repository that will hit (above link) and cache using artifactory, so that I can pull locally, but it does not seem to work.

遵循以下指示: http://www.jfrog.com/confluence/显示/RTF/Npm +存储库

其他人在代理方面遇到困难吗?我已经看到了许多有关更改配置设置的帖子,但这不是我所需要的,我必须遵循工件以获取所需的东西,并且已根据工件建议的方式相应地更改了配置设置,即npm config set set

Anyone else experience difficulties with proxy? I have seen many posts on changing config settings, but this is not what I need, I have to follow artifactory to get what I need, and I have changed my config settings accordingly to how artifactory advises, ie npm config set registry

谢谢!

推荐答案

错误消息表明npm试图寻找名为"artifactory"而不是"bower"的软件包:

The error message indicated that npm tried looking for a package named 'artifactory' instead of 'bower' :

'artifactory'不在npm注册表中

'artifactory' is not in the npm registry

这可能是由于各种错误配置而发生的:

This can happen due to various misconfiguration:

  1. 配置Artifactory存储库以使用错误的注册表URL,例如 https://registry.npmjs.org/artifactory
  2. 配置npm以使用错误的注册表URL:npm config set registry http://myserver:8081/artifactory/api/npm/npmjs-registry/artifactory
  1. Configuring the Artifactory repository to use a wrong registry URL like https://registry.npmjs.org/artifactory
  2. Configuring npm to use a wrong registry URL: npm config set registry http://myserver:8081/artifactory/api/npm/npmjs-registry/artifactory

这两种情况都会导致Artifactory使用以下URL将请求发送到公共注册表: https://registry.npmjs.org/artifactory/bower ,而不是 https://registry.npmjs.org/bower

Both cases will cause Artifactory to send requests to the public registry with the following URL: https://registry.npmjs.org/artifactory/bower instead of https://registry.npmjs.org/bower

为了确保您的设置正确,请尝试以下操作:

In order to make sure your setup is correct, try the following:

  1. 在Artifactory的编辑远程存储库"窗口中单击测试"按钮,以验证注册表URL正确并且Artifactory可以访问它.
  2. 验证存储在.npmrc配置文件中的注册表URL.例如,您可以发送获取"bower"软件包信息的请求:curl -vv http://myserver:8081/artifactory/api/npm/npm-repo-name/bower

  1. Click the "Test" button in the Artifactory "Edit Remote Repository" window to verify that the registry URL is correct and Artifactory can reach it
  2. Verify the registry URL stored in the .npmrc configuration file. For example, you can send a request for getting the 'bower' package info: curl -vv http://myserver:8081/artifactory/api/npm/npm-repo-name/bower

如果npm安装仍然失败,请查看npm-debug.log和Artifactory日志文件以获取更多信息

If npm install still fails, look at the npm-debug.log and the Artifactory log files for more info

这篇关于NPM安装不适用于代理附近的工件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆