node.js - npm returning 404 and 405 errors when connecting to Nexus 3 -
background:
i have new installation of nexus oss 3 have configured repository proxy official npm repo. have added users , added 'npm bearer token realm' list of active realms. repository status "online - remote connection pending..." , user i'm trying connect has admin access.
problem:
i attempting login repo 2 different systems, each using different versions of node 0.10.x (currently required dev needs) , npm (one came packaged node, 1 updated current). on 1 system 405 error following output:
~$ npm login --loglevel verbose --registry=https://repo.xxx.com/repository/xxxx-npm/ npm info worked if ends ok npm verb cli [ '/usr/local/bin/node', npm verb cli '/usr/local/bin/npm', npm verb cli 'login', npm verb cli '--loglevel', npm verb cli 'verbose', npm verb cli '--registry=https://repo.xxx.com/repository/xxx-npm/' ] npm info using npm@1.4.28 npm info using node@v0.10.36 npm verb config skipping project config: /home/ubuntu/.npmrc. (matches userconfig) username: (user.name) password: (or leave unchanged) email: (this public) (user.name@xxx.com) npm verb adduser before first put { name: 'user.name', npm verb adduser password: 'xxxxx', npm verb adduser email: 'user.name@xxx.com', npm verb adduser _id: 'org.couchdb.user:user.name', npm verb adduser type: 'user', npm verb adduser roles: [], npm verb adduser date: '2016-09-22t17:41:52.249z' } npm verb request /-/user/org.couchdb.user:user.name npm verb request registry https://repo.xxx.com/ npm verb request id f911025c53b0616e npm verb url raw /-/user/org.couchdb.user:user.name npm verb url resolving [ 'https://repo.xxx.com/', npm verb url resolving './-/user/org.couchdb.user:user.name' ] npm verb url resolved https://repo.xxx.com/-/user/org.couchdb.user:user.name npm verb request https://repo.xxx.com/-/user/org.couchdb.user:user.name npm info trying registry request attempt 1 @ 10:41:52 npm http put https://repo.xxx.com/-/user/org.couchdb.user:user.name npm http 405 https://repo.xxx.com/-/user/org.couchdb.user:user.name npm verb headers { date: 'thu, 22 sep 2016 17:41:52 gmt', npm verb headers server: 'nexus/3.0.2-02 (oss)', npm verb headers 'x-frame-options': 'sameorigin', npm verb headers 'x-content-type-options': 'nosniff', npm verb headers connection: 'close' } npm verb adduser [ '405 method not allowed', null, undefined ] npm err! 405 method not allowed npm verb exit [ 1, true ] npm err! not ok code 0
on second system 404 error following output:
npm login --registry=https://repo.xxx.com/repository/xxx-npm/ username: user.name password: email: (this public) user.name@xxx.com npm err! linux 3.13.0-91-generic npm err! argv "node" "/home/ubuntu/nvm/v0.10.46/bin/npm" "login" "--registry=https://repo.xxx.com/repository/xxx-npm/" npm err! node v0.10.46 npm err! npm v3.10.8 npm err! code e404 npm err! 404 not found npm err! please include following file support request: npm err! /home/ubuntu/xvela-app/npm-debug.log
and here npm-debug.log attempt:
0 info worked if ends ok 1 verbose cli [ 'node', 1 verbose cli '/home/ubuntu/nvm/v0.10.46/bin/npm', 1 verbose cli 'login', 1 verbose cli '--registry=https://repo.xxx.com/repository/xxx-npm/' ] 2 info using npm@3.10.8 3 info using node@v0.10.46 4 verbose adduser before first put { _id: 'org.couchdb.user:user.name', 4 verbose adduser name: 'user.name', 4 verbose adduser password: 'xxxxx', 4 verbose adduser email: 'user.name@xxx.com', 4 verbose adduser type: 'user', 4 verbose adduser roles: [], 4 verbose adduser date: '2016-09-22t16:37:53.671z' } 5 verbose request uri https://repo.xxx.com/repository/xxx-npm/-/user/org.couchdb.user:user.name 6 verbose request new user, can't send auth 7 info attempt registry request try #1 @ 16:37:53 8 verbose request id e00f9c93ae664e01 9 http request put https://repo.xxx.com/repository/xxx-npm/-/user/org.couchdb.user:user.name 10 http 404 https://repo.xxx.com/repository/xxx-npm/-/user/org.couchdb.user:user.name 11 verbose headers { date: 'thu, 22 sep 2016 16:37:54 gmt', 11 verbose headers server: 'nexus/3.0.2-02 (oss)', 11 verbose headers 'x-frame-options': 'sameorigin', 11 verbose headers 'x-content-type-options': 'nosniff', 11 verbose headers connection: 'close' } 12 verbose request invalidating /home/ubuntu/.npm/repo.xxx.com/repository/xxx-npm/-/user/org.couchdb.user_3auser.name on put 13 verbose adduser [ { [error: 404 not found] statuscode: 404, code: 'e404' }, 13 verbose adduser null, 13 verbose adduser undefined ] 14 verbose stack error: 404 not found 14 verbose stack @ makeerror (/home/ubuntu/nvm/v0.10.46/lib/node_modules/npm/node_modules/npm-registry-client/lib/request.js:302:12) 14 verbose stack @ cachingregistryclient.<anonymous> (/home/ubuntu/nvm/v0.10.46/lib/node_modules/npm/node_modules/npm-registry-client/lib/request.js:253:9) 14 verbose stack @ request._callback (/home/ubuntu/nvm/v0.10.46/lib/node_modules/npm/node_modules/npm-registry-client/lib/request.js:210:14) 14 verbose stack @ request.self.callback (/home/ubuntu/nvm/v0.10.46/lib/node_modules/npm/node_modules/request/request.js:187:22) 14 verbose stack @ request.emit (events.js:98:17) 14 verbose stack @ request.<anonymous> (/home/ubuntu/nvm/v0.10.46/lib/node_modules/npm/node_modules/request/request.js:1044:10) 14 verbose stack @ request.emit (events.js:95:17) 14 verbose stack @ incomingmessage.<anonymous> (/home/ubuntu/nvm/v0.10.46/lib/node_modules/npm/node_modules/request/request.js:965:12) 14 verbose stack @ incomingmessage.emit (events.js:117:20) 14 verbose stack @ _stream_readable.js:944:16 15 verbose statuscode 404 16 verbose cwd /home/ubuntu/xxx-app 17 error linux 3.13.0-91-generic 18 error argv "node" "/home/ubuntu/nvm/v0.10.46/bin/npm" "login" "--registry=https://repo.xxx.com/repository/xxx-npm/" 19 error node v0.10.46 20 error npm v3.10.8 21 error code e404 22 error 404 not found 23 verbose exit [ 1, true ]
i've wikigoogled heck out of , nexus isn't showing evidence of these connection attempts in it's logs. appreciated.
cheers!
the npm login command doesn't work proxy npm repositories (it work group , hosted repositories though).
https://issues.sonatype.org/browse/nexus-10149
that's getting fixed in 3.1 release.
try putting proxy repo group repo, , using group repo's url.
Comments
Post a Comment