-
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
[TOO MANY TANGENTS] [BUG] misleading error: npm WARN config init.author.name Use --init-author-name
instead.
#5279
Comments
fwiw, in my |
Related to #4840 WorkaroundIt appears that the desired behavior is to
npm config set init-author-name "Your Name"
npm config set init-author-email "[email protected]"
npm config set init-author-url "https://yourblog.com"
npm config set init-version "1.0.0"
npm config set init-license "SEE LICENSE IN LICENSE"
npm config set scripts-prepend-node-path true (I've also updated Getting Started with NPM (as a developer) with the new syntax) Migrating from earlier versions# Author Info
npm config set init-author-name "$(
npm config get init.author.name
)"
npm config delete init.author.name
npm config set init-author-email "$(
npm config get init.author.email
)"
npm config delete init.author.email
npm config set init-author-url "$(
npm config get init.author.url
)"
npm config delete init.author.url
# Package Defaults
npm config set init-version "$(
npm config get init.version
)"
npm config delete init.version
npm config set init-license "$(
npm config get init.license
)"
npm config delete init.license |
It's ini, so afaik As for the dots, |
Couldn't this be Auto-Migrated?Is there a material reason this be duplicated automatically and then ignored (unless different) for compatibility with previous versions?
|
Off Topic: Comment Syntax
Historically it's been There's also I come from the node v0.2 days and my .npmrc has been updated but never deleted/re-created from scratch, so there's a variety of cruft in there, none of which generated warnings until quite recently - well, except that one time all the credentials had to be regenerated and actually use tokens instead of (hashed?) creds. follow up Yeah, any duplicate Any line starting with
An abuse of the quasi-ini syntax, no doubt. |
Update npm with the command npm i -g npm. Run command npm cache verify and then run npm i. Delete node_modules folder and package-JSON then run npm i. |
$ npm cache clean --force |
Yeah I’m pretty sure that’s not a comment, that’s a key named that, including the slashes. npm is likely stripping all keys it doesn’t understand, which includes those non-comments. |
Off Topic: Comment Syntax
No, it preserves them. The known comments are stripped. Before npm config
; I will be deleted
# I will also be deleted
// I will live forever, in your heart = After npm confignpm config set scripts-prepend-node-path true
// I will live forever, in your heart=
scripts-prepend-node-path=true |
ah interesting |
I'm having trouble following this issue. Is there a dot-separated entry in your npmrc? If so that will always cause this warning to happen. Removing it/updating it to the hyphen-separated version will fix this. Additionally |
It doesn't appear there's an actual bug here, npm is working as expected. |
--init-author-name
instead.--init-author-name
instead.
Updated
See #5302.
The discussion went in unhelpful directions. #5302 replaces this issue.
Original
Is there an existing issue for this?
This issue exists in the latest npm version
Current Behavior
If I run the config command to set my name, I get a confusing and misleading warning:
So 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
.Keywords for the sake of SEO and people trying to search for this in the GitHub tool:
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
Steps To Reproduce
As shown above.
Environment
; N/A
The text was updated successfully, but these errors were encountered: