我们已经设置了一个带有jfrog artifactory saas的npm。 npm有npm-local和npm-remote存储库。
npm-remote存储库使用默认设置指向https://registry.npmjs.org。
我有〜/ .npmrc如下(遵循神器的说明)
_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 ]
我在这里出错了什么?
干杯 罗希特夏尔
答案 0 :(得分:2)
问题与npm issue有关,它是在npm 5.0版本中引入的 此问题的修复程序将在未来几天内部署到Artifactory SaaS 此外,npm团队也正在努力修复客户端。