Work with npm Packages

You can install npm packages for use in a Studio Two site's code. Manage packages directly from the terminal in the Code tab. There is no separate package manager UI.

Install an npm package

Before using an npm package, you need to install it.

Important: By installing an npm package, you agree to the package's license agreement.

To install an npm package:

  1. In the Studio Two editor, open the Code tab.
  2. Open the terminal. Press Cmd+J (Mac) or Ctrl+J (Windows/Linux), or click the panel toggle button in the top-right toolbar of the Code tab.
  3. In the terminal, run:
    Copy
    The editor automatically saves changes to package.json and package-lock.json after the install completes.
  4. Open package.json in your project to confirm the package appears in the dependencies.
  5. Find usage instructions in the package's README file, available at npmjs.com.

You can then import the package in a site's code:

Copy

Install a specific version

To install a specific version of a package, append @<version> to the package name:

Copy

You can find available versions on the package's page at npmjs.com.

Update a package

Important: After updating a package, make sure your code is compatible with the new version.

To update a package to its latest compatible version:

  1. Open the terminal (Cmd+J on Mac, Ctrl+J on Windows/Linux).
  2. Run:
    Copy
  3. Open package.json to confirm the updated version.

Uninstall a package

Warning: When you uninstall a package, update any code that relies on it.

To uninstall a package:

  1. Open the terminal (Cmd+J on Mac, Ctrl+J on Windows/Linux).
  2. Run:
    Copy
  3. Open package.json to confirm the package no longer appears in the dependencies.

See also

Last updated: 2 November 2026

Did this help?