Closed zot24 closed 7 years ago
@zot24 I don't think this is an npm-registry-client bug. I believe the answer will be obvious if you edit /usr/local/lib/node_modules/semantic-release/node_modules/request/request.js:755
and log out the headers in the reqOptions
object. I'll leave this open largely because I'm very curious about what this is.
Thanks for your suggestion @zkat this was killing me (spoilers) I found the error ☺️ (spoilers)
I realise while checking that file as you suggested that you could add NODE_DEBUG
so I did add NODE_DEBUG=request
to my env var and this is the result of the query
semantic-release verb init Verifying config.
semantic-release verb pre Running pre-script.
semantic-release verb pre Veriying conditions.
semantic-release verb pre Wrote authToken to .npmrc.
verb request uri https://registry.npmjs.org/moltin
verb request no auth needed
info attempt registry request try #1 at 8:48:09 AM
verb request using bearer token for auth
verb request id f0fe055d5bc8625e
http request GET https://registry.npmjs.org/moltin
REQUEST { url:
Url {
protocol: 'https:',
slashes: true,
auth: null,
host: 'registry.npmjs.org',
port: null,
hostname: 'registry.npmjs.org',
hash: null,
search: null,
query: null,
pathname: '/moltin',
path: '/moltin',
href: 'https://registry.npmjs.org/moltin' },
method: 'GET',
headers:
{ 'accept-encoding': 'gzip',
authorization: 'Bearer 3299d44f-88b1-46fa-bdf9-912af33bca78\n',
version: '7.5.0',
accept: 'application/json',
'npm-session': 'f0fe055d5bc8625e',
'npm-in-ci': 'true',
'user-agent': 'node/v7.10.0' },
strictSSL: true,
agent:
Agent {
domain: null,
_events: { free: [Function] },
_eventsCount: 1,
_maxListeners: undefined,
defaultPort: 443,
protocol: 'https:',
options:
{ key: undefined,
cert: undefined,
ca: undefined,
rejectUnauthorized: true,
localAddress: undefined,
maxSockets: 50,
keepAlive: true,
path: null },
requests: {},
sockets: {},
freeSockets: {},
keepAliveMsecs: 1000,
keepAlive: true,
maxSockets: 50,
maxFreeSockets: 256,
maxCachedSessions: 100,
_sessionCache: { map: {}, list: [] } },
followRedirect: true,
encoding: null,
callback: [Function] }
REQUEST make request https://registry.npmjs.org/moltin
authorization: 'Bearer 3299d44f-88b1-46fa-bdf9-912af33bca78\n',
\n
Just to explain the why
and satisfy your curiosity it was all my fault because I was doing this
echo \$(cat .npmrc) | sed -n -e 's/^.*_authToken=//p'
Instead of this go gather the NPM_TOKEN form .npmrc
echo -n \$(cat .npmrc) | sed -n -e 's/^.*_authToken=//p'
Note: That token it's no longer valid 😉
awesome! Glad you figured it out!
Any idea why I could be getting the following error?
with
I'm using the following library semantic-release/semantic-release that use their on dependecy last-release-npm that use npm/npm-registry-client
The whole error looks like: