# jf pnpm Configure pnpm for dependency resolution through Artifactory. This topic covers the following tasks: * [Configure pnpm for Artifactory (`jf pnpm-config`)](#configuration-jf-pnpm-config) ## When to Use Use `jf pnpm-config` to configure pnpm to resolve packages from Artifactory. After configuration, standard `pnpm install` commands resolve from your Artifactory repository. For npm-based projects, use [`jf npm`](jf-npm.md). For Yarn-based projects, use [`jf yarn`](jf-yarn.md). ## Prerequisites * pnpm must be installed (version 6.x or above). * Configure a server with `jf config add` or `jf c add`. * Authentication to Artifactory is required. * Run `jf pnpm-config` in the project directory before the first build. *** ## Configuration: `jf pnpm-config` Generate pnpm configuration for resolving packages through Artifactory. **Run this once per project before your first build.** **To configure pnpm for Artifactory:** ### Synopsis ``` jf pnpm-config [options] ``` **Aliases:** `pnpmc` ### Configuration Options | Flag | Default | Description | | --------------------- | ------- | ------------------------------------------------------------------------------------ | | `--global` | `false` | Set to true for global configuration (all projects). Specific projects can override. | | `--server-id-resolve` | — | Artifactory server ID for resolution. Configure with `jf config add`. | | `--repo-resolve` | — | Repository for dependencies resolution | ### Configuration Examples #### View Help ```bash jf pnpm-config --help ``` #### Non-Interactive Configuration with Flags ```bash jf pnpm-config --server-id-resolve= --repo-resolve= ``` Where: * \: The server ID configured using `jf config add` * \: The name of the npm repository in Artifactory For example: ```bash jf pnpm-config --server-id-resolve=my-server --repo-resolve=npm-virtual ``` ### Why Run Config First? You must run `jf pnpm-config` **before** using `pnpm install` with Artifactory. The config command creates a `.jfrog/projects/pnpm.yaml` file in your project directory that sets the pnpm registry to point to your Artifactory repository. Without it, pnpm resolves from the default public npm registry. > **Shortcut**: In CI/CD, pass all flags non-interactively so the config step is fully automated and reproducible. ### Configuration Notes * **Config-only**: There is no `jf pnpm` run command. After running `jf pnpm-config`, use standard pnpm commands (`pnpm install`, `pnpm add`, etc.) with Artifactory as the registry. * **Resolution only**: pnpm config supports dependency resolution but not deployment. To publish packages, use `jf npm publish` or native `pnpm publish` instead. * **Run once per project**: The configuration persists in `.jfrog/projects/`. Re-run only when changing repository assignments. * **Global vs project**: Use `--global` to apply to all pnpm projects on the machine. Without it, configuration is project-specific (recommended). ### Expected Output ``` $ jf pnpm-config --server-id-resolve=my-server --repo-resolve=npm-virtual pnpm build configuration saved successfully. ``` ### How to Verify After running, confirm the configuration exists: ```bash cat .jfrog/projects/pnpm.yaml ``` *** ## After Configuration After running `jf pnpm-config`, use standard pnpm commands. JFrog CLI configures the registry to point to Artifactory, so native commands resolve from it automatically: ```bash # 1. Configure once jf pnpm-config --server-id-resolve=my-server --repo-resolve=npm-virtual # 2. Use standard pnpm — dependencies resolve from Artifactory pnpm install # 3. To publish a package, use jf npm publish or native pnpm publish pnpm publish ``` > **Note:** Build-info collection is not currently available for pnpm. If you need build-info, consider using [`jf npm`](jf-npm.md) instead. *** ## Important Notes * **Config-only**: There is no `jf pnpm` run command. After running `jf pnpm-config`, use standard pnpm commands with Artifactory as the registry. * **Resolution only**: pnpm config supports dependency resolution. For publishing, use `jf npm publish` or native `pnpm publish`. * **No build-info collection**: Unlike `jf npm` or `jf yarn`, pnpm does not support build-info collection through JFrog CLI. ## CI/CD Example (GitHub Actions) ```yaml # .github/workflows/build.yml steps: - uses: actions/checkout@v4 - name: Setup JFrog CLI uses: jfrog/setup-jfrog-cli@v4 env: JF_URL: ${{ vars.JF_URL }} JF_ACCESS_TOKEN: ${{ secrets.JF_ACCESS_TOKEN }} - name: Configure pnpm run: jf pnpm-config --server-id-resolve=setup-jfrog-cli-server --repo-resolve=npm-virtual - name: Install dependencies run: pnpm install ``` ## Troubleshooting | Symptom | Cause | Fix | | ------------------------------------------------------------- | ----------------------------------------------------- | ------------------------------------------------------------------------------ | | `pnpm install` does not resolve from Artifactory after config | Config not applied or registry not set | Re-run `jf pnpm-config` and verify with `pnpm config get registry` | | 404 on `pnpm install` | Resolution repository does not exist or name is wrong | Verify the repo name matches an existing npm virtual repository in Artifactory | | 401 / 403 errors | Invalid credentials or insufficient permissions | Re-run `jf config add` with a valid access token; check repo permissions | | Need build-info collection | pnpm does not support build-info | Use [`jf npm`](jf-npm.md) for build-info collection | **Enable debug logging:** `export JFROG_CLI_LOG_LEVEL=DEBUG`
## Related Topics * [Build Tools Overview](/artifactory/docs/build-tool-commands) — Capabilities matrix and tool reference * [Native Mode](/artifactory/docs/native-mode) — Supported packages with Native Mode