`NPM need auth auth required for publishing` error (`npm whoami` shows logged in as correct user)
See original GitHub issueExpected Behavior
lerna publish
should publish my packages
Current Behavior
lerna publish
does not publish my packages
no lerna-debug.log
or npm-debug.log
is created
package.json
s are updated correctly
lerna.json
is updated correctly
following error is received
log
? Are you sure you want to publish the above changes? Yes
lerna info publish Publishing packages to npm...
lerna ERR! publish Retrying failed publish: emdaer-plugin-heading
(node:44146) UnhandledPromiseRejectionWarning: Unhandled promise rejection (rejection id: 3): Error: Command failed: npm publish --tag latest
npm ERR! Darwin 17.0.0
npm ERR! argv "/Users/flipactual/.nvm/versions/node/v7.10.0/bin/node" "/Users/flipactual/.nvm/versions/node/v7.10.0/bin/npm" "publish" "--tag" "latest"
npm ERR! node v7.10.0
npm ERR! npm v4.2.0
npm ERR! code ENEEDAUTH
npm ERR! need auth auth required for publishing
npm ERR! need auth You need to authorize this machine using `npm adduser`
npm ERR! Please include the following file with any support request:
npm ERR! /Users/flipactual/.npm/_logs/2017-06-24T21_43_37_157Z-debug.log
(node:44146) DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.
lerna ERR! publish Retrying failed publish: emdaer-core
(node:44146) UnhandledPromiseRejectionWarning: Unhandled promise rejection (rejection id: 6): Error: Command failed: npm publish --tag latest
npm ERR! Darwin 17.0.0
npm ERR! argv "/Users/flipactual/.nvm/versions/node/v7.10.0/bin/node" "/Users/flipactual/.nvm/versions/node/v7.10.0/bin/npm" "publish" "--tag" "latest"
npm ERR! node v7.10.0
npm ERR! npm v4.2.0
npm ERR! code ENEEDAUTH
npm ERR! need auth auth required for publishing
npm ERR! need auth You need to authorize this machine using `npm adduser`
npm ERR! Please include the following file with any support request:
npm ERR! /Users/flipactual/.npm/_logs/2017-06-24T21_43_37_171Z-debug.log
lerna ERR! publish Retrying failed publish: emdaer-cli
(node:44146) UnhandledPromiseRejectionWarning: Unhandled promise rejection (rejection id: 9): Error: Command failed: npm publish --tag latest
npm ERR! Darwin 17.0.0
npm ERR! argv "/Users/flipactual/.nvm/versions/node/v7.10.0/bin/node" "/Users/flipactual/.nvm/versions/node/v7.10.0/bin/npm" "publish" "--tag" "latest"
npm ERR! node v7.10.0
npm ERR! npm v4.2.0
npm ERR! code ENEEDAUTH
npm ERR! need auth auth required for publishing
npm ERR! need auth You need to authorize this machine using `npm adduser`
npm ERR! Please include the following file with any support request:
npm ERR! /Users/flipactual/.npm/_logs/2017-06-24T21_43_37_276Z-debug.log
lerna ERR! publish Retrying failed publish: emdaer-plugin-linebreak
(node:44146) UnhandledPromiseRejectionWarning: Unhandled promise rejection (rejection id: 12): Error: Command failed: npm publish --tag latest
npm ERR! Darwin 17.0.0
npm ERR! argv "/Users/flipactual/.nvm/versions/node/v7.10.0/bin/node" "/Users/flipactual/.nvm/versions/node/v7.10.0/bin/npm" "publish" "--tag" "latest"
npm ERR! node v7.10.0
npm ERR! npm v4.2.0
npm ERR! code ENEEDAUTH
npm ERR! need auth auth required for publishing
npm ERR! need auth You need to authorize this machine using `npm adduser`
npm ERR! Please include the following file with any support request:
npm ERR! /Users/flipactual/.npm/_logs/2017-06-24T21_43_37_352Z-debug.log
lerna ERR! publish Retrying failed publish: emdaer-core
(node:44146) UnhandledPromiseRejectionWarning: Unhandled promise rejection (rejection id: 15): Error: Command failed: npm publish --tag latest
npm ERR! Darwin 17.0.0
npm ERR! argv "/Users/flipactual/.nvm/versions/node/v7.10.0/bin/node" "/Users/flipactual/.nvm/versions/node/v7.10.0/bin/npm" "publish" "--tag" "latest"
npm ERR! node v7.10.0
npm ERR! npm v4.2.0
npm ERR! code ENEEDAUTH
npm ERR! need auth auth required for publishing
npm ERR! need auth You need to authorize this machine using `npm adduser`
npm ERR! Please include the following file with any support request:
npm ERR! /Users/flipactual/.npm/_logs/2017-06-24T21_43_39_870Z-debug.log
lerna ERR! publish Retrying failed publish: emdaer-plugin-heading
(node:44146) UnhandledPromiseRejectionWarning: Unhandled promise rejection (rejection id: 18): Error: Command failed: npm publish --tag latest
npm ERR! Darwin 17.0.0
npm ERR! argv "/Users/flipactual/.nvm/versions/node/v7.10.0/bin/node" "/Users/flipactual/.nvm/versions/node/v7.10.0/bin/npm" "publish" "--tag" "latest"
npm ERR! node v7.10.0
npm ERR! npm v4.2.0
npm ERR! code ENEEDAUTH
npm ERR! need auth auth required for publishing
npm ERR! need auth You need to authorize this machine using `npm adduser`
npm ERR! Please include the following file with any support request:
npm ERR! /Users/flipactual/.npm/_logs/2017-06-24T21_43_39_901Z-debug.log
lerna ERR! publish Retrying failed publish: emdaer-plugin-linebreak
(node:44146) UnhandledPromiseRejectionWarning: Unhandled promise rejection (rejection id: 21): Error: Command failed: npm publish --tag latest
npm ERR! Darwin 17.0.0
npm ERR! argv "/Users/flipactual/.nvm/versions/node/v7.10.0/bin/node" "/Users/flipactual/.nvm/versions/node/v7.10.0/bin/npm" "publish" "--tag" "latest"
npm ERR! node v7.10.0
npm ERR! npm v4.2.0
npm ERR! code ENEEDAUTH
npm ERR! need auth auth required for publishing
npm ERR! need auth You need to authorize this machine using `npm adduser`
npm ERR! Please include the following file with any support request:
npm ERR! /Users/flipactual/.npm/_logs/2017-06-24T21_43_40_327Z-debug.log
lerna ERR! publish Retrying failed publish: emdaer-cli
(node:44146) UnhandledPromiseRejectionWarning: Unhandled promise rejection (rejection id: 24): Error: Command failed: npm publish --tag latest
npm ERR! Darwin 17.0.0
npm ERR! argv "/Users/flipactual/.nvm/versions/node/v7.10.0/bin/node" "/Users/flipactual/.nvm/versions/node/v7.10.0/bin/npm" "publish" "--tag" "latest"
npm ERR! node v7.10.0
npm ERR! npm v4.2.0
npm ERR! code ENEEDAUTH
npm ERR! need auth auth required for publishing
npm ERR! need auth You need to authorize this machine using `npm adduser`
npm ERR! Please include the following file with any support request:
npm ERR! /Users/flipactual/.npm/_logs/2017-06-24T21_43_40_378Z-debug.log
lerna ERR! publish Retrying failed publish: emdaer-core
(node:44146) UnhandledPromiseRejectionWarning: Unhandled promise rejection (rejection id: 27): Error: Command failed: npm publish --tag latest
npm ERR! Darwin 17.0.0
npm ERR! argv "/Users/flipactual/.nvm/versions/node/v7.10.0/bin/node" "/Users/flipactual/.nvm/versions/node/v7.10.0/bin/npm" "publish" "--tag" "latest"
npm ERR! node v7.10.0
npm ERR! npm v4.2.0
npm ERR! code ENEEDAUTH
npm ERR! need auth auth required for publishing
npm ERR! need auth You need to authorize this machine using `npm adduser`
npm ERR! Please include the following file with any support request:
npm ERR! /Users/flipactual/.npm/_logs/2017-06-24T21_43_42_698Z-debug.log
lerna ERR! publish Retrying failed publish: emdaer-plugin-heading
(node:44146) UnhandledPromiseRejectionWarning: Unhandled promise rejection (rejection id: 30): Error: Command failed: npm publish --tag latest
npm ERR! Darwin 17.0.0
npm ERR! argv "/Users/flipactual/.nvm/versions/node/v7.10.0/bin/node" "/Users/flipactual/.nvm/versions/node/v7.10.0/bin/npm" "publish" "--tag" "latest"
npm ERR! node v7.10.0
npm ERR! npm v4.2.0
npm ERR! code ENEEDAUTH
npm ERR! need auth auth required for publishing
npm ERR! need auth You need to authorize this machine using `npm adduser`
npm ERR! Please include the following file with any support request:
npm ERR! /Users/flipactual/.npm/_logs/2017-06-24T21_43_42_840Z-debug.log
lerna ERR! publish Retrying failed publish: emdaer-plugin-linebreak
(node:44146) UnhandledPromiseRejectionWarning: Unhandled promise rejection (rejection id: 33): Error: Command failed: npm publish --tag latest
npm ERR! Darwin 17.0.0
npm ERR! argv "/Users/flipactual/.nvm/versions/node/v7.10.0/bin/node" "/Users/flipactual/.nvm/versions/node/v7.10.0/bin/npm" "publish" "--tag" "latest"
npm ERR! node v7.10.0
npm ERR! npm v4.2.0
npm ERR! code ENEEDAUTH
npm ERR! need auth auth required for publishing
npm ERR! need auth You need to authorize this machine using `npm adduser`
npm ERR! Please include the following file with any support request:
npm ERR! /Users/flipactual/.npm/_logs/2017-06-24T21_43_43_400Z-debug.log
lerna ERR! publish Retrying failed publish: emdaer-cli
(node:44146) UnhandledPromiseRejectionWarning: Unhandled promise rejection (rejection id: 36): Error: Command failed: npm publish --tag latest
npm ERR! Darwin 17.0.0
npm ERR! argv "/Users/flipactual/.nvm/versions/node/v7.10.0/bin/node" "/Users/flipactual/.nvm/versions/node/v7.10.0/bin/npm" "publish" "--tag" "latest"
npm ERR! node v7.10.0
npm ERR! npm v4.2.0
npm ERR! code ENEEDAUTH
npm ERR! need auth auth required for publishing
npm ERR! need auth You need to authorize this machine using `npm adduser`
npm ERR! Please include the following file with any support request:
npm ERR! /Users/flipactual/.npm/_logs/2017-06-24T21_43_43_419Z-debug.log
lerna ERR! publish Retrying failed publish: emdaer-core
(node:44146) UnhandledPromiseRejectionWarning: Unhandled promise rejection (rejection id: 39): Error: Command failed: npm publish --tag latest
npm ERR! Darwin 17.0.0
npm ERR! argv "/Users/flipactual/.nvm/versions/node/v7.10.0/bin/node" "/Users/flipactual/.nvm/versions/node/v7.10.0/bin/npm" "publish" "--tag" "latest"
npm ERR! node v7.10.0
npm ERR! npm v4.2.0
npm ERR! code ENEEDAUTH
npm ERR! need auth auth required for publishing
npm ERR! need auth You need to authorize this machine using `npm adduser`
npm ERR! Please include the following file with any support request:
npm ERR! /Users/flipactual/.npm/_logs/2017-06-24T21_43_45_576Z-debug.log
lerna ERR! publish Retrying failed publish: emdaer-plugin-heading
(node:44146) UnhandledPromiseRejectionWarning: Unhandled promise rejection (rejection id: 42): Error: Command failed: npm publish --tag latest
npm ERR! Darwin 17.0.0
npm ERR! argv "/Users/flipactual/.nvm/versions/node/v7.10.0/bin/node" "/Users/flipactual/.nvm/versions/node/v7.10.0/bin/npm" "publish" "--tag" "latest"
npm ERR! node v7.10.0
npm ERR! npm v4.2.0
npm ERR! code ENEEDAUTH
npm ERR! need auth auth required for publishing
npm ERR! need auth You need to authorize this machine using `npm adduser`
npm ERR! Please include the following file with any support request:
npm ERR! /Users/flipactual/.npm/_logs/2017-06-24T21_43_45_868Z-debug.log
lerna ERR! publish Retrying failed publish: emdaer-plugin-linebreak
(node:44146) UnhandledPromiseRejectionWarning: Unhandled promise rejection (rejection id: 45): Error: Command failed: npm publish --tag latest
npm ERR! Darwin 17.0.0
npm ERR! argv "/Users/flipactual/.nvm/versions/node/v7.10.0/bin/node" "/Users/flipactual/.nvm/versions/node/v7.10.0/bin/npm" "publish" "--tag" "latest"
npm ERR! node v7.10.0
npm ERR! npm v4.2.0
npm ERR! code ENEEDAUTH
npm ERR! need auth auth required for publishing
npm ERR! need auth You need to authorize this machine using `npm adduser`
npm ERR! Please include the following file with any support request:
npm ERR! /Users/flipactual/.npm/_logs/2017-06-24T21_43_46_371Z-debug.log
lerna ERR! publish Retrying failed publish: emdaer-cli
(node:44146) UnhandledPromiseRejectionWarning: Unhandled promise rejection (rejection id: 48): Error: Command failed: npm publish --tag latest
npm ERR! Darwin 17.0.0
npm ERR! argv "/Users/flipactual/.nvm/versions/node/v7.10.0/bin/node" "/Users/flipactual/.nvm/versions/node/v7.10.0/bin/npm" "publish" "--tag" "latest"
npm ERR! node v7.10.0
npm ERR! npm v4.2.0
npm ERR! code ENEEDAUTH
npm ERR! need auth auth required for publishing
npm ERR! need auth You need to authorize this machine using `npm adduser`
npm ERR! Please include the following file with any support request:
npm ERR! /Users/flipactual/.npm/_logs/2017-06-24T21_43_46_603Z-debug.log
lerna ERR! publish Ran out of retries while publishing emdaer-core Error: Command failed: npm publish --tag latest
lerna ERR! publish npm ERR! Darwin 17.0.0
lerna ERR! publish npm ERR! argv "/Users/flipactual/.nvm/versions/node/v7.10.0/bin/node" "/Users/flipactual/.nvm/versions/node/v7.10.0/bin/npm" "publish" "--tag" "latest"
lerna ERR! publish npm ERR! node v7.10.0
lerna ERR! publish npm ERR! npm v4.2.0
lerna ERR! publish npm ERR! code ENEEDAUTH
lerna ERR! publish
lerna ERR! publish npm ERR! need auth auth required for publishing
lerna ERR! publish npm ERR! need auth You need to authorize this machine using `npm adduser`
lerna ERR! publish
lerna ERR! publish npm ERR! Please include the following file with any support request:
lerna ERR! publish npm ERR! /Users/flipactual/.npm/_logs/2017-06-24T21_43_49_004Z-debug.log
lerna ERR! publish
lerna ERR! publish at Promise.all.then.arr (/Users/flipactual/Dev/emdaer/node_modules/execa/index.js:210:11)
lerna ERR! publish at process._tickCallback (internal/process/next_tick.js:109:7)
lerna ERR! execute callback with error
lerna ERR! execute Error: Command failed: npm publish --tag latest
lerna ERR! execute npm ERR! Darwin 17.0.0
lerna ERR! execute npm ERR! argv "/Users/flipactual/.nvm/versions/node/v7.10.0/bin/node" "/Users/flipactual/.nvm/versions/node/v7.10.0/bin/npm" "publish" "--tag" "latest"
lerna ERR! execute npm ERR! node v7.10.0
lerna ERR! execute npm ERR! npm v4.2.0
lerna ERR! execute npm ERR! code ENEEDAUTH
lerna ERR! execute
lerna ERR! execute npm ERR! need auth auth required for publishing
lerna ERR! execute npm ERR! need auth You need to authorize this machine using `npm adduser`
lerna ERR! execute
lerna ERR! execute npm ERR! Please include the following file with any support request:
lerna ERR! execute npm ERR! /Users/flipactual/.npm/_logs/2017-06-24T21_43_49_004Z-debug.log
lerna ERR! execute
lerna ERR! execute at Promise.all.then.arr (/Users/flipactual/Dev/emdaer/node_modules/execa/index.js:210:11)
lerna ERR! execute at process._tickCallback (internal/process/next_tick.js:109:7)
lerna WARN complete Waiting for 3 child processes to exit. CTRL-C to exit immediately.
(node:44146) UnhandledPromiseRejectionWarning: Unhandled promise rejection (rejection id: 51): Error: Command failed: npm publish --tag latest
npm ERR! Darwin 17.0.0
npm ERR! argv "/Users/flipactual/.nvm/versions/node/v7.10.0/bin/node" "/Users/flipactual/.nvm/versions/node/v7.10.0/bin/npm" "publish" "--tag" "latest"
npm ERR! node v7.10.0
npm ERR! npm v4.2.0
npm ERR! code ENEEDAUTH
npm ERR! need auth auth required for publishing
npm ERR! need auth You need to authorize this machine using `npm adduser`
npm ERR! Please include the following file with any support request:
npm ERR! /Users/flipactual/.npm/_logs/2017-06-24T21_43_49_004Z-debug.log
lerna ERR! publish Ran out of retries while publishing emdaer-plugin-heading Error: Command failed: npm publish --tag latest
lerna ERR! publish npm ERR! Darwin 17.0.0
lerna ERR! publish npm ERR! argv "/Users/flipactual/.nvm/versions/node/v7.10.0/bin/node" "/Users/flipactual/.nvm/versions/node/v7.10.0/bin/npm" "publish" "--tag" "latest"
lerna ERR! publish npm ERR! node v7.10.0
lerna ERR! publish npm ERR! npm v4.2.0
lerna ERR! publish npm ERR! code ENEEDAUTH
lerna ERR! publish
lerna ERR! publish npm ERR! need auth auth required for publishing
lerna ERR! publish npm ERR! need auth You need to authorize this machine using `npm adduser`
lerna ERR! publish
lerna ERR! publish npm ERR! Please include the following file with any support request:
lerna ERR! publish npm ERR! /Users/flipactual/.npm/_logs/2017-06-24T21_43_49_510Z-debug.log
lerna ERR! publish
lerna ERR! publish at Promise.all.then.arr (/Users/flipactual/Dev/emdaer/node_modules/execa/index.js:210:11)
lerna ERR! publish at process._tickCallback (internal/process/next_tick.js:109:7)
(node:44146) UnhandledPromiseRejectionWarning: Unhandled promise rejection (rejection id: 54): Error: Command failed: npm publish --tag latest
npm ERR! Darwin 17.0.0
npm ERR! argv "/Users/flipactual/.nvm/versions/node/v7.10.0/bin/node" "/Users/flipactual/.nvm/versions/node/v7.10.0/bin/npm" "publish" "--tag" "latest"
npm ERR! node v7.10.0
npm ERR! npm v4.2.0
npm ERR! code ENEEDAUTH
npm ERR! need auth auth required for publishing
npm ERR! need auth You need to authorize this machine using `npm adduser`
npm ERR! Please include the following file with any support request:
npm ERR! /Users/flipactual/.npm/_logs/2017-06-24T21_43_49_510Z-debug.log
lerna ERR! publish Ran out of retries while publishing emdaer-plugin-linebreak Error: Command failed: npm publish --tag latest
lerna ERR! publish npm ERR! Darwin 17.0.0
lerna ERR! publish npm ERR! argv "/Users/flipactual/.nvm/versions/node/v7.10.0/bin/node" "/Users/flipactual/.nvm/versions/node/v7.10.0/bin/npm" "publish" "--tag" "latest"
lerna ERR! publish npm ERR! node v7.10.0
lerna ERR! publish npm ERR! npm v4.2.0
lerna ERR! publish npm ERR! code ENEEDAUTH
lerna ERR! publish
lerna ERR! publish npm ERR! need auth auth required for publishing
lerna ERR! publish npm ERR! need auth You need to authorize this machine using `npm adduser`
lerna ERR! publish
lerna ERR! publish npm ERR! Please include the following file with any support request:
lerna ERR! publish npm ERR! /Users/flipactual/.npm/_logs/2017-06-24T21_43_49_931Z-debug.log
lerna ERR! publish
lerna ERR! publish at Promise.all.then.arr (/Users/flipactual/Dev/emdaer/node_modules/execa/index.js:210:11)
lerna ERR! publish at process._tickCallback (internal/process/next_tick.js:109:7)
(node:44146) UnhandledPromiseRejectionWarning: Unhandled promise rejection (rejection id: 57): Error: Command failed: npm publish --tag latest
npm ERR! Darwin 17.0.0
npm ERR! argv "/Users/flipactual/.nvm/versions/node/v7.10.0/bin/node" "/Users/flipactual/.nvm/versions/node/v7.10.0/bin/npm" "publish" "--tag" "latest"
npm ERR! node v7.10.0
npm ERR! npm v4.2.0
npm ERR! code ENEEDAUTH
npm ERR! need auth auth required for publishing
npm ERR! need auth You need to authorize this machine using `npm adduser`
npm ERR! Please include the following file with any support request:
npm ERR! /Users/flipactual/.npm/_logs/2017-06-24T21_43_49_931Z-debug.log
error Command failed with exit code 1.
Possible Solution
No clue, sorry
Steps to Reproduce (for bugs)
https://github.com/emdaer/emdaer
had https://github.com/emdaer/emdaer/commit/fcd0919623253064a7c0d49346e3e6af31d772c5 ready, ran yarn lerna
(I’ve got weird build steps due to babel/flow/etc), received error in terminal
https://github.com/emdaer/emdaer/commit/dd4c8c0ecbbe2335650998ea6f637ef74bdec007 was created along with a git tag
nothing was published
lerna.json
{
"lerna": "2.0.0-rc.5",
"packages": [
"packages/emdaer-cli",
"packages/emdaer-core",
"packages/emdaer-plugin-heading",
"packages/emdaer-plugin-linebreak",
"packages/emdaer-transform-smartypants"
],
"version": "1.0.0-bluerose.5"
}
Context
Trying to publish packages
Your Environment
Executable | Version |
---|---|
lerna --version |
2.0.0-rc.5 |
npm --version |
4.2.0 |
yarn --version |
0.24.6 |
node --version |
v7.10.0 |
OS | Version |
---|---|
macOS High Sierra | 10.13 Beta |
Issue Analytics
- State:
- Created 6 years ago
- Reactions:13
- Comments:10 (4 by maintainers)
Top Results From Across the Web
`npm publish` and `npm install` fail depending on `.npmrc ...
NPM's documentation states there is no need to include the authToken in the project .npmrc . Authenticating with npm login and storing the ......
Read more >npm-publish | npm Docs
This is a one-time password from a two-factor authenticator. It's needed when publishing or changing package permissions with npm access . If not...
Read more >to correct this please trying logging in again with: npm err ...
NPM ERR Code E401: Unable to authenticate, need: Bearer authorization ... First, delete the .npmrc file in your Users folder. This folder:.
Read more >Logging in and out | Introduction
To publish a package, you must have a user on the npm registry. If you don't have one, you can create it 2...
Read more >npm packages in the Package Registry - GitLab Docs
Publish to GitLab Package Registry. Authentication to the Package Registry. You need an token to publish a package. There are different tokens available ......
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
I found that the problem is somehow connected with
yarn
. When you runpublish
, thennpm-run-path
assigns yarn registry url to env variablenpm_config_registry
. So whenlerna
spawnsnpm publish
,npm
is using yarn’s registry url and this causes errorENEEDAUTH
.As a workaround for now, we have to use
lerna publish --registry=https://registry.npmjs.org/
or specify theregistry
inlerna.json
. It forced given registry URL.Oy, that’s a subtle bug. Maybe we should always pass
npm_config_registry
, defaulting the option tohttps://registry.npmjs.org/
so it always “just works” with custom--registry
config?