私有nexus npm代理注册表和tarball位置

私有nexus npm代理注册表和tarball位置,npm,nexus3,npm-registry,Npm,Nexus3,Npm Registry,我们正在使用Nexus作为公司构建环境中的工件存储库。我们为maven、nuget和npm等配置了代理存储库/注册表。我们的jenkins build服务器只能访问我们的本地intranet,因此它们通过Nexus代理repos来提取工件。这对maven和nuget来说非常有效,但是当涉及到npm时,我遇到了一个问题 .npmrc包含: registry=https://nexus.local/nexus/repository/npm-official/ "devDependenci

我们正在使用Nexus作为公司构建环境中的工件存储库。我们为maven、nuget和npm等配置了代理存储库/注册表。我们的jenkins build服务器只能访问我们的本地intranet,因此它们通过Nexus代理repos来提取工件。这对maven和nuget来说非常有效,但是当涉及到npm时,我遇到了一个问题

.npmrc
包含:

registry=https://nexus.local/nexus/repository/npm-official/
"devDependencies": {
  "eslint": "^7.2.0",
  "eslint-config-airbnb-base": "^14.2.0",
  "eslint-plugin-import": "^2.21.2",
  "eslint-plugin-jquery": "^1.5.1"
}
{
    _id: "color-name-1.1.3",
    gitHead: "cb7d4629b00fe38564f741a0779f6ad84d8007a2",
    maintainers: [{
        name: "dfcreative",
        email: "df.creative@gmail.com"
    }],
    _from: ".",
    keywords: [
        "color-name",
        "color",
        "color-keyword",
        "keyword"
    ],
    author: {
        name: "DY",
        email: "dfcreative@gmail.com"
    },
    _npmVersion: "4.6.1",
    description: "A list of color names and its values",
    dist: {
        shasum: "a7d0558bd89c42f795dd42328f740831ca53bc25",
        tarball: "https://registry.npmjs.org/color-name/-/color-name-1.1.3.tgz"
    },
    _npmOperationalInternal: {
        host: "s3://npm-registry-packages",
        tmp: "tmp/color-name-1.1.3.tgz_1500157027207_0.5641644957941025"
    },
    main: "index.js",
    _shasum: "a7d0558bd89c42f795dd42328f740831ca53bc25",
    repository: {
        type: "git",
        url: "git+ssh://git@github.com/dfcreative/color-name.git"
    },
    version: "1.1.3",
    license: "MIT",
    bugs: {
        url: "https://github.com/dfcreative/color-name/issues"
    },
    _npmUser: {
        name: "dfcreative",
        email: "df.creative@gmail.com"
    },
    versions: {},
    name: "color-name",
    directories: {},
    time: {
        created: "2020-07-02T19:22:42.404Z",
        modified: "2020-07-02T19:22:42.404Z"
    },
    scripts: {
        test: "node test.js"
    },
    homepage: "https://github.com/dfcreative/color-name",
    _nodeVersion: "8.1.2"
}
我的
package.json
文件包含:

registry=https://nexus.local/nexus/repository/npm-official/
"devDependencies": {
  "eslint": "^7.2.0",
  "eslint-config-airbnb-base": "^14.2.0",
  "eslint-plugin-import": "^2.21.2",
  "eslint-plugin-jquery": "^1.5.1"
}
{
    _id: "color-name-1.1.3",
    gitHead: "cb7d4629b00fe38564f741a0779f6ad84d8007a2",
    maintainers: [{
        name: "dfcreative",
        email: "df.creative@gmail.com"
    }],
    _from: ".",
    keywords: [
        "color-name",
        "color",
        "color-keyword",
        "keyword"
    ],
    author: {
        name: "DY",
        email: "dfcreative@gmail.com"
    },
    _npmVersion: "4.6.1",
    description: "A list of color names and its values",
    dist: {
        shasum: "a7d0558bd89c42f795dd42328f740831ca53bc25",
        tarball: "https://registry.npmjs.org/color-name/-/color-name-1.1.3.tgz"
    },
    _npmOperationalInternal: {
        host: "s3://npm-registry-packages",
        tmp: "tmp/color-name-1.1.3.tgz_1500157027207_0.5641644957941025"
    },
    main: "index.js",
    _shasum: "a7d0558bd89c42f795dd42328f740831ca53bc25",
    repository: {
        type: "git",
        url: "git+ssh://git@github.com/dfcreative/color-name.git"
    },
    version: "1.1.3",
    license: "MIT",
    bugs: {
        url: "https://github.com/dfcreative/color-name/issues"
    },
    _npmUser: {
        name: "dfcreative",
        email: "df.creative@gmail.com"
    },
    versions: {},
    name: "color-name",
    directories: {},
    time: {
        created: "2020-07-02T19:22:42.404Z",
        modified: "2020-07-02T19:22:42.404Z"
    },
    scripts: {
        test: "node test.js"
    },
    homepage: "https://github.com/dfcreative/color-name",
    _nodeVersion: "8.1.2"
}
当从构建服务器运行
npm install--verbose
时,我得到:

npm http 200 https://nexus.local/nexus/repository/npm-official/color-name/1.1.3
npm verb lock https://registry.npmjs.org/color-name/-/color-name-1.1.3.tgz /home/jenkins/.npm/8ac054f7--color-name-color-name-1-1-3-tgz.lock
npm verb addRemoteTarball [ 'https://registry.npmjs.org/color-name/-/color-name-1.1.3.tgz',
npm verb addRemoteTarball   'a7d0558bd89c42f795dd42328f740831ca53bc25' ]
npm info retry fetch attempt 1 at 15:30:29
npm verb fetch to= /home/jenkins/tmp/npm-21841-6pArnCsg/1593718229216-0.7411239189095795/tmp.tgz
npm http GET https://registry.npmjs.org/color-name/-/color-name-1.1.3.tgz

...snip...

npm ERR! fetch failed https://registry.npmjs.org/rimraf/-/rimraf-2.6.3.tgz
npm info retry will retry, error on last attempt: Error: connect ETIMEDOUT
npm ERR! fetch failed https://registry.npmjs.org/write/-/write-1.0.3.tgz
npm info retry will retry, error on last attempt: Error: connect ETIMEDOUT
npm ERR! fetch failed https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz
npm info retry will retry, error on last attempt: Error: connect ETIMEDOUT
npm ERR! fetch failed https://registry.npmjs.org/color-name/-/color-name-1.1.3.tgz
npm info retry will retry, error on last attempt: Error: connect ETIMEDOUT
npm info retry fetch attempt 2 at 15:31:41
npm verb fetch to= /home/jenkins/tmp/npm-21841-6pArnCsg/1593718228477-0.851270338287577/tmp.tgz
npm http GET https://registry.npmjs.org/rimraf/-/rimraf-2.6.3.tgz
npm info retry fetch attempt 2 at 15:31:41
npm verb fetch to= /home/jenkins/tmp/npm-21841-6pArnCsg/1593718228481-0.010538662783801556/tmp.tgz
npm http GET https://registry.npmjs.org/write/-/write-1.0.3.tgz
npm info retry fetch attempt 2 at 15:31:41
npm verb fetch to= /home/jenkins/tmp/npm-21841-6pArnCsg/1593718228609-0.7893481529317796/tmp.tgz
npm http GET https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz
npm info retry fetch attempt 2 at 15:31:42
npm verb fetch to= /home/jenkins/tmp/npm-21841-6pArnCsg/1593718229216-0.7411239189095795/tmp.tgz
npm http GET https://registry.npmjs.org/color-name/-/color-name-1.1.3.tgz
npm ERR! fetch failed https://registry.npmjs.org/rimraf/-/rimraf-2.6.3.tgz
npm info retry will retry, error on last attempt: Error: connect ETIMEDOUT
npm ERR! fetch failed https://registry.npmjs.org/write/-/write-1.0.3.tgz
npm info retry will retry, error on last attempt: Error: connect ETIMEDOUT
npm ERR! fetch failed https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz
npm info retry will retry, error on last attempt: Error: connect ETIMEDOUT
npm ERR! fetch failed https://registry.npmjs.org/color-name/-/color-name-1.1.3.tgz
npm info retry will retry, error on last attempt: Error: connect ETIMEDOUT
在此之前还有很多输出,如果必要的话,我很乐意提供。从
https://nexus.local/nexus/repository/npm-official/color-name/1.1.3
包含:

registry=https://nexus.local/nexus/repository/npm-official/
"devDependencies": {
  "eslint": "^7.2.0",
  "eslint-config-airbnb-base": "^14.2.0",
  "eslint-plugin-import": "^2.21.2",
  "eslint-plugin-jquery": "^1.5.1"
}
{
    _id: "color-name-1.1.3",
    gitHead: "cb7d4629b00fe38564f741a0779f6ad84d8007a2",
    maintainers: [{
        name: "dfcreative",
        email: "df.creative@gmail.com"
    }],
    _from: ".",
    keywords: [
        "color-name",
        "color",
        "color-keyword",
        "keyword"
    ],
    author: {
        name: "DY",
        email: "dfcreative@gmail.com"
    },
    _npmVersion: "4.6.1",
    description: "A list of color names and its values",
    dist: {
        shasum: "a7d0558bd89c42f795dd42328f740831ca53bc25",
        tarball: "https://registry.npmjs.org/color-name/-/color-name-1.1.3.tgz"
    },
    _npmOperationalInternal: {
        host: "s3://npm-registry-packages",
        tmp: "tmp/color-name-1.1.3.tgz_1500157027207_0.5641644957941025"
    },
    main: "index.js",
    _shasum: "a7d0558bd89c42f795dd42328f740831ca53bc25",
    repository: {
        type: "git",
        url: "git+ssh://git@github.com/dfcreative/color-name.git"
    },
    version: "1.1.3",
    license: "MIT",
    bugs: {
        url: "https://github.com/dfcreative/color-name/issues"
    },
    _npmUser: {
        name: "dfcreative",
        email: "df.creative@gmail.com"
    },
    versions: {},
    name: "color-name",
    directories: {},
    time: {
        created: "2020-07-02T19:22:42.404Z",
        modified: "2020-07-02T19:22:42.404Z"
    },
    scripts: {
        test: "node test.js"
    },
    homepage: "https://github.com/dfcreative/color-name",
    _nodeVersion: "8.1.2"
}
该硬编码的tarball位置用于获取归档文件,正如您从上面的日志中看到的,它无法检索归档文件,因为此生成服务器只有本地intranet访问权限。如果我手动访问
https://nexus.local/nexus/repository/npm-official/color-name/-/color-name-1.1.3.tgz
在浏览器中,存档成功下载

因此,npm代理注册表正在工作,但tarball位置似乎是问题所在。有没有可能从我的代理回购协议中提取tarball?我是否缺少一些设置/配置选项,这些设置/配置选项会导致那些tarball位置使用相对于我定义的代理注册表的位置?似乎不止一个
eslint
的依赖项存在此问题。它不仅仅限于
颜色名称