question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

npm plugin: issues with legacyAuth

See original GitHub issue

Describe the bug

Setting legacyAuth to true in auto config, does not properly send the value of _auth to npm publish.

To Reproduce

  1. setup a npm project to use auto and the npm plugin
  2. set legacyAuth to true in the plugin field
  3. set publishConfig.registry in your package.json to be an external registry
  4. make a .env file, add in NPM_TOKEN
  5. run npx auto canary and see below error:
Error: Running command 'npm' with args [publish, --tag, canary, --_auth, MASKED_NPM_TOKEN] failed

npm ERR! code ERR_INVALID_ARG_TYPE
npm ERR! The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type boolean

(MASKED_NPM_TOKEN being the actual value from .env’s NPM_TOKEN)

Expected behavior

Should be passing the token correctly to npm publish.

Additional context

Looking at this block of code, it passes to execPromise, and the token is considered an argument and not the value.

If I changed those lines to the below, all is functional:

return [
    options.isMonorepo ? "--legacy-auth" : "--_auth" + `=${process.env.NPM_TOKEN}`,
];

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:7 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
sethomascommented, Jan 20, 2021

ah you want me to fork, one moment

0reactions
adierkenscommented, Jan 20, 2021

🚀 Issue was released in v10.11.0 🚀

Read more comments on GitHub >

github_iconTop Results From Across the Web

@spraoi/legacy-auth - npm Package Health Analysis | Snyk
Ensure you're using the healthiest npm packages. Snyk scans all the packages in your projects for vulnerabilities and provides automated fix ...
Read more >
NPM Plugin - Intuit
legacyAuth. When publishing packages that require authentication but you are working with an internally hosted npm registry that only uses the legacy Base64 ......
Read more >
npm v9.0.0 released | GitHub Changelog
login , adduser , and auth-type changes. legacy auth types sso , saml & legacy have been consolidated into "legacy" · timing and...
Read more >
NPM error while trying to make a auth system using Laravel ...
1 Answer 1 ; Update your node.js to the latest. make sure that the node version is up to date by running: $...
Read more >
Index of /bootstrap-3.3.4/node_modules/npm-shrinkwrap ...
... adduser-legacy-auth.js · bitbucket-https-url-with-creds-package.js ... npm-api-not-loaded-error.js · optional-metadep-rollback-collision.js ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found