Skip to content

Instantly share code, notes, and snippets.

@mcous
Created April 17, 2018 01:13
Show Gist options
  • Save mcous/0c62847401ed2dc5e230f38746f0c267 to your computer and use it in GitHub Desktop.
Save mcous/0c62847401ed2dc5e230f38746f0c267 to your computer and use it in GitHub Desktop.
npm auth bug in `yarn run`

npm auth bug in yarn run

Scripts run with yarn run seem to break npm auth.

Tested on:

  • macOS 10.12.6
  • node v8.11.0
  • npm v5.8.0
  • yarn v1.6.0

repro

  1. Delete or move .yarnrc
  2. yarn cache clean
  3. Ensure .npmrc is set up properly with an authToken
  4. npm whoami works
  5. npm run who works
  6. yarn run who fails with ENEEDAUTH

workaround

  1. yarn config set registry https://registry.npmjs.org
  2. yarn run who works
{
"name": "yarn-run-whoami",
"version": "1.0.0",
"main": "index.js",
"license": "MIT",
"scripts": {
"who": "npm whoami"
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment