JetBrains Space Help

Get npm Packages

The typical way of getting an npm package is installing it using the npm or yarn tools.

  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 | Security | Personal Tokens page.

    Automatically generated token for an npm registry
  3. In Space, open Packages and find the desired npm package.

    Note that you can use the npm search command to find a package by its name, for example:

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

  4. Open the package properties page.

  5. In the snippets field, select your tool and copy the snippet code.

    npm snippets
  6. Run the snippet on your local machine.

Alternatively, you can download the package using Download package Download and install it from your local machine.

Last modified: 14 July 2020