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.,
npm initspecifying 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, and when you're ready simply type
Note: some auth strategies introduce additional requirements, e.g., the GitHub Strategy requires that you populate the
repositoryfield in your package.json.