Skip to content

[BUG] "npm install" not working for private artifactories #2008

Closed
@dnalborczyk

Description

@dnalborczyk

Current Behavior:

npm install with npm v7.0.2 throws the following exception (verbose log):

➜ npm i graphql --verbose
npm verb cli [
npm verb cli   '/Users/daniel/.nvs/node/15.0.0/x64/bin/node',
npm verb cli   '/Users/daniel/.nvs/node/15.0.0/x64/bin/npm',
npm verb cli   'i',
npm verb cli   'graphql',
npm verb cli   '--verbose'
npm verb cli ]
npm info using npm@7.0.2
npm info using node@v15.0.0
npm timing config:load:defaults Completed in 1ms
npm timing config:load:file:/Users/daniel/.nvs/node/15.0.0/x64/lib/node_modules/npm/npmrc Completed in 1ms
npm timing config:load:builtin Completed in 1ms
npm timing config:load:cli Completed in 1ms
npm timing config:load:env Completed in 1ms
npm timing config:load:file:/Users/daniel/redacted/test/npm-7/.npmrc Completed in 0ms
npm timing config:load:project Completed in 0ms
npm timing config:load:file:/Users/daniel/.npmrc Completed in 1ms
npm timing config:load:user Completed in 2ms
npm timing config:load:file:/Users/daniel/.nvs/node/15.0.0/x64/etc/npmrc Completed in 0ms
npm timing config:load:global Completed in 0ms
npm timing config:load:cafile Completed in 0ms
npm timing config:load:validate Completed in 2ms
npm timing config:load:setUserAgent Completed in 0ms
npm timing config:load:setEnvs Completed in 1ms
npm timing config:load Completed in 9ms
npm verb npm-session 8e4eb2e06a0ea959
npm timing npm:load Completed in 19ms
npm timing arborist:ctor Completed in 0ms
npm timing idealTree:init Completed in 17ms
npm timing idealTree:userRequests Completed in 2ms
npm http fetch GET 401 https://redacted.jfrog.io/artifactory/api/npm/npm-prod/graphql 235ms
npm timing idealTree:#root Completed in 242ms
npm timing idealTree:node_modules/graphql Completed in 0ms
npm timing idealTree:buildDeps Completed in 243ms
npm timing idealTree:fixDepFlags Completed in 1ms
npm timing idealTree Completed in 263ms
npm timing command:install Completed in 266ms
npm verb stack Error: Unable to authenticate, need: Basic realm="Artifactory Realm"
npm verb stack     at /Users/daniel/.nvs/node/15.0.0/x64/lib/node_modules/npm/node_modules/npm-registry-fetch/check-response.js:113:17
npm verb stack     at processTicksAndRejections (node:internal/process/task_queues:93:5)
npm verb stack     at async Arborist.[buildDepStep] (/Users/daniel/.nvs/node/15.0.0/x64/lib/node_modules/npm/node_modules/@npmcli/arborist/lib/arborist/build-ideal-tree.js:760:11)
npm verb stack     at async Arborist.buildIdealTree (/Users/daniel/.nvs/node/15.0.0/x64/lib/node_modules/npm/node_modules/@npmcli/arborist/lib/arborist/build-ideal-tree.js:202:7)
npm verb stack     at async Promise.all (index 1)
npm verb stack     at async Arborist.reify (/Users/daniel/.nvs/node/15.0.0/x64/lib/node_modules/npm/node_modules/@npmcli/arborist/lib/arborist/reify.js:121:5)
npm verb stack     at async install (/Users/daniel/.nvs/node/15.0.0/x64/lib/node_modules/npm/lib/install.js:40:5)
npm verb statusCode 401
npm verb pkgid graphql@*
npm verb cwd /Users/daniel/redacted/test/npm-7
npm verb Darwin 19.6.0
npm verb argv "/Users/daniel/.nvs/node/15.0.0/x64/bin/node" "/Users/daniel/.nvs/node/15.0.0/x64/bin/npm" "i" "graphql" "--verbose"
npm verb node v15.0.0
npm verb npm  v7.0.2
npm ERR! code E401
npm ERR! Incorrect or missing password.
npm ERR! If you were trying to login, change your password, create an
npm ERR! authentication token or enable two-factor authentication then
npm ERR! that means you likely typed your password in incorrectly.
npm ERR! Please try again, or recover your password at:
npm ERR!     https://www.npmjs.com/forgot
npm ERR! 
npm ERR! If you were doing some other operation then your saved credentials are
npm ERR! probably out of date. To correct this please try logging in again with:
npm ERR!     npm login
npm verb exit 1
npm timing npm Completed in 602ms

npm ERR! A complete log of this run can be found in:
npm ERR!     /Users/daniel/.npm/_logs/2020-10-21T17_23_26_626Z-debug.log

.npmrc:

_auth="redacted=="
always-auth=true
email=redacted@redacted.me
registry=https://redacted.jfrog.io/artifactory/api/npm/npm-prod/
@redacted:registry=https://redacted.jfrog.io/artifactory/api/npm/npm-prod/

Expected Behavior:

should just work. the above works with npm v6+

Steps To Reproduce:

see above

Environment:

macOS Catalina 10.15.6
node.js v15.0.0 (but also reproduces with node.js v14.14.0 and a global npm upgrade to v7)
npm v7.0.2

if it matters:
nvs v1.6.0

Metadata

Metadata

Assignees

Labels

Bugthing that needs fixingRelease 7.xwork is associated with a specific npm 7 release

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions