npm uploads its own package and updates its own published package

Question 1: How to upload your own package to npm

1. Perform project initialization:

npm init

2. Log in to the npm account and publish the package (you need to complete the email registration, because at this time you will be asked to enter the email and fill in the one-time password received by the email)

npm login

3. After logging in, publish the package. After npm pblish is successful, a one-time password will be sent to the mailbox. Enter and press Enter to complete the release.

npm publish

4. After the release is complete, enter the npm official website to view your own packages. In the project, you can use the command line npm i your package name to download the package you released;

Question 2: How to update the npm package published by yourself

1. Log in to your own npm account, the same as step 4 of question 1

2. Execute npm version update type

npm version

3. Execute npm publish

npm publish

Guess you like

Origin blog.csdn.net/leoxingc/article/details/131315573