npm pkg set private=true

Category: Node.js & npm/yarn

npm pkg set private=true

Mark the package as private

Sets the private field so npm publish refuses to upload the package accidentally, which is essential for app repositories that are not meant to be libraries. Internal-only packages should always carry this flag. npm pkg get private shows the current value.
Looking for more? Search all 7,657 commands — works offline, in English or Spanish, and fixes typos.