-
Notifications
You must be signed in to change notification settings - Fork 3.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[BUG] misleading error: npm WARN config init.author.name Use --init-author-name
instead.
#5302
Comments
Clarifications@wraithgar What's unclear / what questions do you have? WorkaroundFor others encountering this bug, see #5279: Workaround (comment) |
npm's deprecation system is a string that is shown whenever a deprecated config item is seen. This is manifesting after We're not likely to change this in npm 8 but I will add a suggestion to npm 9 that |
* Update config fields for npm - Update my email address to `i@fengyj.cn`. - Use `init-license`(and others) instead of `init.license`(and others). Update above settings config fields to remove warnings. More to see: - npm/cli#5302 - https://stackoverflow.com/questions/71914123/warning-in-npm-config-at-latest-version/72113809#72113809 * Update copyright author for LICENSE: Huiyi.FYJ => Feng.YJ. * Switch the default branch from `master` to `main`, and update related URL links in README file. For refer to https://github.blog/changelog/2020-10-01-the-default-branch-for-newly-created-repositories-is-now-main/ * Update copyright year to 2023 in README file. * Add backup tsinghua TUNA mirror URL for flutter.
Is there an existing issue for this?
#5279 was confusing due to tangential, unrelated discussion.
This issue exists in the latest npm version
Current Behavior A
This is incorrect and/or silly.
--init-author-name
is NOT a valid config option or flagCurrent Behavior B
This is NOT correct. It writes an invalid value to
.npmrc
.Expected Behavior
Either the built-in documentation should be updated to give the output the corresponds to the expected input
Or the parsing should change to allow the given output as input in some way
For example:
npm ERR breaking change: you must now use `npm config set init-author-name` instead of `npm config set init.author.name`. [exit 1]
Or
Or
npm config --init-author-name "AJ ONeal"
Steps to Reproduce
If I run the config command to set my name:
I get a confusing and misleading warning that gives incorrect / useless feedback:
Either this feedback is incorrect, or the behavior of npm is incorrect.
--init-author-name
is NOT a valid command line flag--init-author-name
is NOT a valid config file entrySo then if I try again a few different ways:
I get usage errors:
And if I try the simplest form I can think of:
npm --init-author-name "AJ ONeal"
I get yet a different usage error:
And I can try putting
--init-author-name
in.npmrc
, but this also doesn't work:These are all ignored on
npm init
.Environment
; N/A
Keywords
Keywords for the sake of SEO and people trying to search for this in the GitHub tool:
The text was updated successfully, but these errors were encountered: