npm Config, Auth & Cache

Configuration, npmrc, cache management, profile, and token workflows.

View
StandardDetailedCompact
Export
Copy the compact sheet, download it, or print it.
Download
`D` dense toggle · `C` copy all
## npm configuration
List config values
npm config list

# Display effective npm configuration.

List all config defaults
npm config ls -l

# Display defaults and computed values.

Get a config value
npm config get registry

# Read a configuration value.

Set a config value
npm config set registry https://registry.npmjs.org/

# Write a configuration value.

Delete a config value
npm config delete proxy

# Remove a config setting.

Edit npmrc
npm config edit

# Open the user npmrc in an editor.

## Cache management
Verify cache
npm cache verify

# Validate the integrity of the npm cache.

Clean cache
npm cache clean --force

# Remove cached data. Force is required.

Add package tarball to cache
npm cache add <package>

# Fetch a package into the local cache.

## Auth tokens and profile
List auth tokens
npm token list

# Show tokens for the current account.

Create auth token
npm token create

# Create a new auth token.

Revoke auth token
npm token revoke <id>

# Delete an auth token.

Get profile info
npm profile get

# Read the current npm profile.

Set profile info
npm profile set fullname "Your Name"

# Update profile fields.

## Environment and paths
Show global prefix
npm prefix -g

# Print the global installation prefix.

Show global node_modules root
npm root -g

# Print the global node_modules directory.

Show global bin path
npm bin -g

# Print the directory where global binaries are linked.

Run npm environment checks
npm doctor

# Check common npm environment problems.

Ping registry
npm ping

# Verify connectivity to the configured registry.

Recommended next

No recommendations yet.