How to Publish NPM Package to npmjs.com

2023/2/51 min read
bookmark this
Responsive image

npm init login to the npmjs.com

Type npm init and follow the steps to login into the npmjs.com.

  npm init

npm publish to publish the package

There're few ways to publish NPM package, private, publish or publish to the organization. Here, we're publish as public, so type below command at the root folder of you node.js source code.

npm publish --access public

That's it.

If there's no error, your package should published to the npmjs.com, check the package under your account, should be able to find the package.