Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How I can publish NPM package with a name different one in package.json?

My package.json has

{
  "name": "package_name",
  "version": "1.0.1"
}

I want publish the package with name example_name. How I can do this?

like image 251
galkin Avatar asked Oct 18 '22 09:10

galkin


1 Answers

When you run npm publish its look at your package.json, So the best thing to do is to change the name in the package.json, run npm publish and then change it back to the your desired name.

You of course can write a script that will do it for you if you need to do it many times

like image 87
Ariel Henryson Avatar answered Oct 19 '22 22:10

Ariel Henryson