我如何改变npm中默认的“作者”?

yi0zb3m4  于 2022-12-27  发布在  其他
关注(0)|答案(2)|浏览(194)

每次我创建新的npm项目时,都有错误的作者名,我可以更改吗?

package name: (template) template
version: (1.0.0)
description:
entry point: (index.js) bot.js
test command:
git repository:
keywords:
license: (ISC)
About to write to:

{
  "name": "template",
  "version": "1.0.0",
  "description": "",
  "main": "bot.js",
  "scripts": {
    "test": "echo \"Error: no test specified\" && exit 1"
  },
  "author": "*wrong author*",
  "license": "ISC"
}
axr492tv

axr492tv1#

您可以按照命令运行

npm config set init.author.name "your name"

或转到package.json文件并编辑作者名。

package name: (template) template
    version: (1.0.0)
    description:
    entry point: (index.js) bot.js
    test command:
    git repository:
    keywords:
    license: (ISC)
    About to write to:

    {
      "name": "template",
      "version": "1.0.0",
      "description": "",
      "main": "bot.js",
      "scripts": {
        "test": "echo \"Error: no test specified\" && exit 1"
      },
      "author": "Rajneesh Shukla",
      "license": "ISC"
    }
quhf5bfb

quhf5bfb2#

也可以使用破折号:
npm配置集初始化作者名“作者名”

相关问题