'Warning in npm config at latest version

I'm currently on [email protected] 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

npm


Solution 1:[1]

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.

Solution 2:[2]

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.

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 user_pt
Solution 2 Dave Bevan