How to publish a package to npm

If you’ve built a package you want to publish as a public package to npm you can follow these steps:

Sign up
Create an organisation
Choose the following option

On the command line, navigate to the root directory of your package

cd /path/to/pack…


This content originally appeared on DEV Community and was authored by mohsen

If you've built a package you want to publish as a public package to npm you can follow these steps:

  1. Sign up
  2. Create an organisation
  3. Choose the following option Screen Shot 2022-04-30 at 11.21.33 am.png
  4. On the command line, navigate to the root directory of your package
cd /path/to/package
  1. Authorize the machine to publish a package
npm login
  1. Publish the package

Assuming you've built the package correctly, you can publish it like this:

npm publish --access public

If you're interested to see a package publish exactly this way, take a look at this repository:

https://github.com/utopiops/utopiops


This content originally appeared on DEV Community and was authored by mohsen


Print Share Comment Cite Upload Translate Updates
APA

mohsen | Sciencx (2022-04-30T04:25:25+00:00) How to publish a package to npm. Retrieved from https://www.scien.cx/2022/04/30/how-to-publish-a-package-to-npm/

MLA
" » How to publish a package to npm." mohsen | Sciencx - Saturday April 30, 2022, https://www.scien.cx/2022/04/30/how-to-publish-a-package-to-npm/
HARVARD
mohsen | Sciencx Saturday April 30, 2022 » How to publish a package to npm., viewed ,<https://www.scien.cx/2022/04/30/how-to-publish-a-package-to-npm/>
VANCOUVER
mohsen | Sciencx - » How to publish a package to npm. [Internet]. [Accessed ]. Available from: https://www.scien.cx/2022/04/30/how-to-publish-a-package-to-npm/
CHICAGO
" » How to publish a package to npm." mohsen | Sciencx - Accessed . https://www.scien.cx/2022/04/30/how-to-publish-a-package-to-npm/
IEEE
" » How to publish a package to npm." mohsen | Sciencx [Online]. Available: https://www.scien.cx/2022/04/30/how-to-publish-a-package-to-npm/. [Accessed: ]
rf:citation
» How to publish a package to npm | mohsen | Sciencx | https://www.scien.cx/2022/04/30/how-to-publish-a-package-to-npm/ |

Please log in to upload a file.




There are no updates yet.
Click the Upload button above to add an update.

You must be logged in to translate posts. Please log in or register.