How can I change default "author" in npm?

Every time I create new npm project, there is wrong author name, can I change it?

   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"
    }

It looks like your post is mostly code; please add some more details.

1 answer

  • answered 2018-11-08 09:42 Rajneesh Shukla

    You can run following Commond

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

    or go to package.json file and edit the auther name.

     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"
        }