JavaScript / Node.js
CloudRepo supports the npm registry protocol for hosting private Node.js packages.
Overview
CloudRepo provides private npm registry hosting with support for all major JavaScript package managers. Whether you’re using npm, Yarn, pnpm, or Bun, CloudRepo integrates seamlessly with your workflow.
Supported Package Formats
Tarballs (.tgz) - Standard npm package format
Scoped packages -
@scope/package-namefully supportedUnscoped packages - Standard
package-nameformat
Supported Tools
npm - The default Node.js package manager
Yarn (v1 and v2+) - Facebook’s package manager
pnpm - Fast, disk-efficient package manager
Bun - All-in-one JavaScript runtime with built-in package manager
Repository Types
Local Repositories
Host your private npm packages:
https://[org-id].mycloudrepo.io/repositories/npm-repo
Features:
Full npm publish and install support
Scoped and unscoped packages
Bearer token authentication (via
npm login)Basic authentication support
HTML directory browsing
210 MB maximum package size
Quick Configuration Examples
npm
; .npmrc
registry=https://[org-id].mycloudrepo.io/repositories/npm-repo/
//[org-id].mycloudrepo.io/repositories/npm-repo/:_authToken=YOUR_TOKEN
always-auth=true
Yarn (v2+)
# .yarnrc.yml
npmRegistryServer: "https://[org-id].mycloudrepo.io/repositories/npm-repo/"
npmRegistries:
"https://[org-id].mycloudrepo.io/repositories/npm-repo/":
npmAuthToken: "YOUR_TOKEN"
pnpm
; .npmrc (pnpm uses .npmrc)
registry=https://[org-id].mycloudrepo.io/repositories/npm-repo/
//[org-id].mycloudrepo.io/repositories/npm-repo/:_authToken=YOUR_TOKEN
always-auth=true
Bun
; .npmrc (Bun falls back to .npmrc)
registry=https://[org-id].mycloudrepo.io/repositories/npm-repo/
//[org-id].mycloudrepo.io/repositories/npm-repo/:_authToken=YOUR_TOKEN
always-auth=true
Authentication Methods
Bearer Token (Recommended)
Use npm login to generate a bearer token:
npm login --registry=https://[org-id].mycloudrepo.io/repositories/npm-repo/
This stores a token in your ~/.npmrc automatically.
Basic Authentication
For CI/CD environments, use base64-encoded credentials:
echo -n 'username:password' | base64
Then configure in .npmrc:
registry=https://[org-id].mycloudrepo.io/repositories/npm-repo/
//[org-id].mycloudrepo.io/repositories/npm-repo/:_auth=BASE64_ENCODED
always-auth=true
Best Practices
Always include
always-auth=truein.npmrcfor private registriesUse bearer tokens (
npm login) for interactive developmentUse base64
_authtokens for CI/CD pipelinesInclude a trailing slash on registry URLs
Use scoped packages (
@yourorg/package) to avoid name conflicts
Next Steps
npm Repositories - Detailed npm CLI setup and usage guide