Why package.json doesn't use the predefined values from .npmrc file?

问题: Windows 10 x64 According this info I created the C:Usersbushm.npmrc file with content: author = "Andrey Bushman" but when I launch the npm init -y command inside of...

问题:

Windows 10 x64

According this info I created the C:Usersbushm.npmrc file with content:

author = "Andrey Bushman"

but when I launch the npm init -y command inside of new directory I see in package.json the property author is empty:

{
  "name": "foo",
  "version": "1.0.0",
  "description": "",
  "main": "index.js",
  "scripts": {
    "test": "echo "Error: no test specified" && exit 1"
  },
  "keywords": [],
  "author": "",
  "license": "ISC"
}

Also, I did it through the command: npm config set author "Andrey Bushman" but I get the same result...

Why does it happen?


回答1:

I don't think author is a supported option for the npmrc file.
Please take a look at this documentation for available options.

DESCRIPTION

npm gets its config settings from the command line, environment variables, and npmrc files.

The npm config command can be used to update and edit the contents of the user and global npmrc files.

For a list of available configuration options, see npm-config.

  • 发表于 2019-03-10 23:56
  • 阅读 ( 59 )
  • 分类:sof

条评论

请先 登录 后评论
不写代码的码农
小编

篇文章

作家榜 »

  1. 小编 文章
返回顶部
部分文章转自于网络,若有侵权请联系我们删除