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