npm
Overview
Your private npm packages and public dependencies from npmjs.org, all managed through one registry.
Supported Clients
JFrog Fly supports npm packages built with:
npm CLI (
npm publish,npm install) - The standard Node.js package manager included with Node.jspnpm (
pnpm publish,pnpm install) - Fast, disk-space-efficient package manager
Upload / Publish Package
With Fly App
Activate npm in your Fly App to configure your .npmrc globally with Fly, then publish as usual:
npm publishUsing pnpm:
pnpm publishManual Configuration
1. Generate an access token in Fly Token Management
2. Configure npm in your project or home directory. Create or edit .npmrc:
registry=https://<your-fly-subdomain>.jfrog.io/artifactory/api/npm/npm/
//<your-fly-subdomain>.jfrog.io/artifactory/api/npm/npm/:_authToken=<your-fly-token>3. Publish:
npm publishUsing pnpm:
pnpm publishImportant
You cannot publish a package version that already exists. Increment the version in your package.json before publishing again.
Download / Install Package
With Fly App
Activate npm in your Fly App to configure your .npmrc globally with Fly, then install as usual:
npm install <package-name>Using pnpm:
pnpm install <package-name>Manual Configuration
1. Generate an access token in Fly Token Management
2. Configure npm in your project or home directory. Create or edit .npmrc:
registry=https://<your-fly-subdomain>.jfrog.io/artifactory/api/npm/npm/
//<your-fly-subdomain>.jfrog.io/artifactory/api/npm/npm/:_authToken=<your-fly-token>3. Install:
npm install <package-name>Using pnpm:
pnpm install <package-name>From Public Registry
When you install a package that isn’t in your Fly Registry, JFrog Fly automatically fetches it from npmjs.org and caches it for future use.
npm install expressUsing pnpm:
pnpm install expressPublish/Install Packages with CI
To publish and install npm packages with CI, update your GitHub Actions workflow to include the Fly action.
Simply ask your coding agent: “Configure my workflows with Fly” and Fly MCP will configure your GitHub Actions workflow yml file, as follows:
1. Add permissions (top level, after on:):
permissions:
contents: read
id-token: write2. Add Fly Action (after actions/setup-node, before npm commands):
- uses: jfrog/fly-action@v1 # Setup Fly package managersGitHub Action Example
name: Build and Publish npm Package
on:
push:
branches: [main]
permissions:
contents: read
id-token: write
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: '18'
- uses: jfrog/fly-action@v1 # Setup Fly package managers
- run: npm install # Dependencies from Fly registry
- run: npm run build
- run: npm publish # Publish to Fly registryBack to Package Managers →