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

时间:2018-11-08 06:54:35

标签: npm

每次创建新的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"
    }

1 个答案:

答案 0 :(得分:-1)

您可以按照Commond运行

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"
    }
相关问题