jf pnpm
Configure pnpm for dependency resolution through Artifactory.
This topic covers the following tasks:
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. For Yarn-based projects, use jf yarn.
Prerequisites
- pnpm must be installed (version 6.x or above).
- Configure a server with
jf config addorjf c add. - Authentication to Artifactory is required.
- Run
jf pnpm-configin the project directory before the first build.
Configuration: jf pnpm-config
jf pnpm-configGenerate 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
jf pnpm-config --helpNon-Interactive Configuration with Flags
jf pnpm-config --server-id-resolve=<server-id> --repo-resolve=<repo-name>Where:
- <server-id>: The server ID configured using
jf config add - <repo-name>: The name of the npm repository in Artifactory
For example:
jf pnpm-config --server-id-resolve=my-server --repo-resolve=npm-virtualWhy 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 pnpmrun command. After runningjf 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 publishor nativepnpm publishinstead. - Run once per project: The configuration persists in
.jfrog/projects/. Re-run only when changing repository assignments. - Global vs project: Use
--globalto 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:
cat .jfrog/projects/pnpm.yamlAfter 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:
# 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 publishNote: Build-info collection is not currently available for pnpm. If you need build-info, consider using
jf npminstead.
Important Notes
- Config-only: There is no
jf pnpmrun command. After runningjf pnpm-config, use standard pnpm commands with Artifactory as the registry. - Resolution only: pnpm config supports dependency resolution. For publishing, use
jf npm publishor nativepnpm publish. - No build-info collection: Unlike
jf npmorjf yarn, pnpm does not support build-info collection through JFrog CLI.
CI/CD Example (GitHub Actions)
# .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 installTroubleshooting
| 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 for build-info collection |
Enable debug logging: export JFROG_CLI_LOG_LEVEL=DEBUG
Related Topics
- Build Tools Overview — Capabilities matrix and tool reference
- Native Mode — Supported packages with Native Mode
Updated 8 days ago
