npm 安装不适用于 jfrog artifactory saas 帐户

npm install not working with jfrog artifactory saas account

我们已经使用 jfrog artifactory saas 设置了一个 npm。 npm 同时具有 npm-local 和 npm-remote 存储库。

npm-remote 存储库指向 https://registry.npmjs.org 默认设置。

我有如下 ~/.npmrc(按照 artifactory 的说明)

_auth="[auth]"
email=[email address]
always-auth=true
registry=https://[company-name].jfrog.io/centricsoftware/api/npm/npm/

我什至能够将 npm 模块发布到 jfrog artifactory 服务器。

我在通过 jfrog artifactory 安装 npm 模块时遇到的问题

$>npm install express
npm ERR! code E401
npm ERR! 401 Unauthorized: express@^4.15.3

npm ERR! A complete log of this run can be found in:
npm ERR!     /Users/[user]/.npm/_logs/2017-06-28T12_14_24_852Z-debug.log

日志文件内容如下

0 info it worked if it ends with ok
1 verbose cli [ '/usr/local/bin/node',
1 verbose cli   '/usr/local/bin/npm',
1 verbose cli   'install',
1 verbose cli   'express' ]
2 info using npm@5.0.4
3 info using node@v8.1.2
4 verbose npm-session 91f67a25a5bc9570
5 silly install loadCurrentTree
6 silly install readLocalPackageData
7 http fetch GET 401 https://centricsoftware.jfrog.io/centricsoftware/api/npm/npm/express 6360ms
8 silly fetchPackageMetaData error for express@^4.15.3 401 Unauthorized: express@^4.15.3
9 verbose stack Error: 401 Unauthorized: express@^4.15.3
9 verbose stack     at fetch.then.res (/usr/local/lib/node_modules/npm/node_modules/pacote/lib/fetchers/registry/fetch.js:41:19)
9 verbose stack     at tryCatcher (/usr/local/lib/node_modules/npm/node_modules/bluebird/js/release/util.js:16:23)
9 verbose stack     at Promise._settlePromiseFromHandler (/usr/local/lib/node_modules/npm/node_modules/bluebird/js/release/promise.js:512:31)
9 verbose stack     at Promise._settlePromise (/usr/local/lib/node_modules/npm/node_modules/bluebird/js/release/promise.js:569:18)
9 verbose stack     at Promise._settlePromise0 (/usr/local/lib/node_modules/npm/node_modules/bluebird/js/release/promise.js:614:10)
9 verbose stack     at Promise._settlePromises (/usr/local/lib/node_modules/npm/node_modules/bluebird/js/release/promise.js:693:18)
9 verbose stack     at Async._drainQueue (/usr/local/lib/node_modules/npm/node_modules/bluebird/js/release/async.js:133:16)
9 verbose stack     at Async._drainQueues (/usr/local/lib/node_modules/npm/node_modules/bluebird/js/release/async.js:143:10)
9 verbose stack     at Immediate.Async.drainQueues (/usr/local/lib/node_modules/npm/node_modules/bluebird/js/release/async.js:17:14)
9 verbose stack     at runCallback (timers.js:800:20)
9 verbose stack     at tryOnImmediate (timers.js:762:5)
9 verbose stack     at processImmediate [as _immediateCallback] (timers.js:733:5)
10 verbose cwd /Users/rohitghatol/tmp/try
11 verbose Darwin 16.6.0
12 verbose argv "/usr/local/bin/node" "/usr/local/bin/npm" "install" "express"
13 verbose node v8.1.2
14 verbose npm  v5.0.4
15 error code E401
16 error 401 Unauthorized: express@^4.15.3
17 verbose exit [ 1, true ]

我哪里错了?

干杯 罗希特

问题与 npm 5.0 版本中引入的 npm issue 有关。
此问题的修复程序将在接下来的几天内部署到 Artifactory SaaS。
此外,npm 团队也在努力修复客户端。