How to set npm credentials using `npm login` without reading from stdin?
TL;DR: Make an HTTP request directly to the registry: TOKEN=$(curl -s \ -H “Accept: application/json” \ -H “Content-Type:application/json” \ -X PUT –data ‘{“name”: “username_here”, “password”: “password_here”}’ \ http://your_registry/-/user/org.couchdb.user:username_here 2>&1 | grep -Po \ ‘(?<=”token”: “)[^”]*’) npm set registry “http://your_registry” npm set //your_registry/:_authToken $TOKEN Rationale Behind the scenes npm adduser makes an HTTP request to the … Read more