On the premise of successfully owning npm users, I want to publish my own package to npm. Here I use my own method to summarize the operation process, hope it will be helpful.
Click to enter npm official website: https://www.npmjs.com/
-
First of all, create a new folder and open the control terminal to run the command.
Next is the following:
this time day01 becomes a package (package.json is generated):
-
The second step is to complete the first step. After writing the package, we want to publish it. Before publishing, we must log in and run the command in the terminal:
-
The third step is to publish. Run the command in the terminal:
the mailbox filled in during runtime will receive the file:
If the npm mirror address is still Taobao, an error will be reported:
modify the npm Taobao address to the original npm official address: click to view the modification method: https://blog.csdn.net/Menqq/article/details/109569342#comments_13766219
Succeed in Npm official website to search published package
successfully posted
When we update the package and want to republish it :
a. Go to the json folder and change the version number:
b. Publish again and run the command in the terminal:
c. Search or refresh again on the npm official website: the
update is successful
Next, if you want to delete a package, run the command in the terminal:
search or refresh again on the npm official website :
successfully deleted