Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How can I change default "author" in npm?

Tags:

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"
}
like image 691
Jakie Avatar asked Nov 08 '18 06:11

Jakie


People also ask

How do I make npm default?

Just type nvm alias default v10. 16.3 in your terminal and then type nvm use default . This command will make v10. 16.3 available in any shell you open — you just have to restart your terminal to make sure it works.

What is the default npm registry?

The default is typically set to the public npm registry at https://registry.npmjs.org/ . For more information about npm configuration files, see the npm config file documentation.

Does npm install save by default?

npm install saves any specified packages into dependencies by default. Additionally, you can control where and how they get saved with some additional flags: -P, --save-prod : Package will appear in your dependencies .


1 Answers

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"
    }
like image 71
Rajneesh Shukla Avatar answered Nov 04 '22 12:11

Rajneesh Shukla