Publishing Packages
Before you can publish a private module, you should follow the steps outlined in the CLI Configuration documentation.
To create a private module, all you need to do is initialize an npm module with the same scope that you used while logging in:
- Create a folder with the name of your module, e.g.,
my-test-module
. Run
npm init
specifying the scope you used while logging in (see Using npm Enterprise for Private Packages):npm init --scope=@mycompany
Fill in information when prompted to generate a package.json file.
Write your module. When you're ready, type
npm publish
.Note: some auth strategies introduce additional requirements, e.g., the GitHub Strategy requires that you populate the
repository
field in your package.json.