JavaScript / Node.js

CloudRepo supports the npm registry protocol for hosting private Node.js packages.

See also

Authenticate with a repository token. Repository Tokens: Create One and Authenticate shows how to create one, with a ready-to-paste example. For npm: npm sends the token alone, as _authToken in .npmrc; there is no username.

Hosted at CloudRepo. See private npm registry hosting for plans and pricing.

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-name fully supported

  • Unscoped packages - Standard package-name format

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

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

Basic Authentication (legacy _auth)

For older CI tooling that requires Basic auth, use _auth. Its value is the base64 of the email address of the account that created the token (in lower case), a colon, and the token. It does not yet reliably accept a token created by the organization owner account:

echo -n 'you@example.com:YOUR_TOKEN' | base64
registry=https://[org-id].mycloudrepo.io/repositories/npm-repo/
//[org-id].mycloudrepo.io/repositories/npm-repo/:_auth=BASE64_ENCODED

Prefer _authToken with a repository token. It scopes the credential to the repositories you choose and rotates independently from your portal password.

Best Practices

  • Create a repository token in the admin portal and use it as _authToken for CI/CD pipelines; it is revocable on its own, unlike a password in _auth

  • Revoke tokens you no longer need with npm token list / npm token revoke <id> against the same --registry

  • npm login opens the admin portal in your browser, so it needs a browser. In CI, configure .npmrc with a repository token instead

  • Include a trailing slash on registry URLs

  • Use scoped packages (@yourorg/package) to avoid name conflicts

Next Steps