Warning in npm config at latest version

Viewed 4976

I'm currently on npm@8.7.0 and every time I run any npm command I have this warning

npm WARN config init.author.email Use `--init-author-email` instead.
npm WARN config init.author.name Use `--init-author-name` instead.
npm WARN config init.license Use `--init-license` instead.

Does anyone knows how to remove these warnings, my global .npmrc only set those above settings

3 Answers

Alternatively, edit your .npmrc file and change "init.author.name" to "init-author-name".

For me, the full list of keys I had to change (replace . with -) was:

Old key                  New key
=======                  =======
init.author.name         init-author-name
init.author.email        init-author-email
init.author.url          init-author-url
init.license             init-license

The error/suggested fix returned was not helpful:

npm WARN config init.author.email Use `--init-author-email` instead.
npm WARN config init.author.name Use `--init-author-name` instead.
npm WARN config init.author.url Use `--init-author-url` instead.
npm WARN config init.license Use `--init-license` instead.

Had the warning been formatted slightly differently, perhaps a post here could have been avoided:

npm WARN config init.author.email Use `init-author-email` instead.
npm WARN config init.author.name Use `init-author-name` instead.
npm WARN config init.author.url Use `init-author-url` instead.
npm WARN config init.license Use `init-license` instead.

I set each one with the config setting the warning instructed.

i.e.

  • npm config set init-license MIT
  • npm config set init-version 0.0.1

Then delete the lines that contained the values in the old way:

  • init.license = MIT
  • init.version = 0.0.1

As a matter of testing, deleting the lines was enough to make the warning cease. However, after testing the values set in the new format; npm init was picking them up.

Some initial information

SO: Ubuntu 22.04 LTS x86_64
npm v: 8.11.0


npm WARN config init.author.email Use --init-author-email instead.
npm WARN config init.author.name Use --init-author-name instead.


This worked for me .

key=init.author.name || init-author-name
value=yourname

  • npm c set key=value

Once the values ​​are entered, you need to remove the old keys.

  • npm c delete init.author.name

Did it solve your question?
If you are interested in taking a look you can find more help by typing in your command line npm c -h

display example

Related