JetBrains Space Help

Publish npm Packages

Let's assume you have an npm package and want to publish it to the newly created npm registry using the npm command-line tool.

Note that publishing packages with the same package version is not allowed. The server will return the 409 HTTP response.

Publish packages using npm command-line tool

  1. Log in to the npm registry:

    npm login --registry https://npm.pkg.jetbrains.space/mycompany/p/projectkey/mynpm

    • https://npm.pkg.jetbrains.space/mycompany/p/projectkey/mynpm is the registry URL

    • mycompany is the name of your company in Space, mynpm is the registry name.

    If you are not sure about the URL, you can copy the URL of a particular npm registry on the Packages page.

  2. When asked for credentials, specify your Space username and password. npm uses permanent tokens for authentication. Once you log in to the registry, Space will automatically create a permanent token specifically for accessing the npm registry. This token will be saved in your local .npmrc configuration file and used for all further connections to the specified registry. You can manage the created token on the My Profile | Personal Tokens page.

    Automatically generated token for an npm registry
  3. Open the directory containing the package you want to publish.

  4. Publish the package to the registry:

    npm publish --registry https://npm.pkg.jetbrains.space/mycompany/p/projectkey/mynpm

Last modified: 20 October 2020