npm plugin: issues with legacyAuth
See original GitHub issueDescribe the bug
Setting legacyAuth
to true in auto
config, does not properly send the value of _auth
to npm publish
.
To Reproduce
- setup a npm project to use
auto
and thenpm
plugin - set
legacyAuth
totrue
in the plugin field - set
publishConfig.registry
in yourpackage.json
to be an external registry - make a
.env
file, add inNPM_TOKEN
- 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:
- Created 3 years ago
- Comments:7 (3 by maintainers)
Top 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 >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 FreeTop 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
Top GitHub Comments
ah you want me to fork, one moment
🚀 Issue was released in
v10.11.0
🚀