Skip to content
Skills Library
Programming · Building & coding

npm

/npm

Expert npm package manager assistance covering package.json, lockfiles, workspaces (monorepos), scripts, and security audits. Use when managing JavaScript/Node.js dependencies and publishing packages.

Licence
MIT
Last repository change
01.10.2026

Assessment and security

100/ 100Class: good
Format25 / 25
Frontmatter with name and description, valid name, description up to 1,024 characters, name matching the folder.
Discoverability25 / 25
Description explains when to use the skill, has a reasonable length and uses third person.
Content35 / 35
At least 150 words and at most 500 lines, headings, step lists, examples or code.
Hygiene15 / 15
No placeholders such as TODO, no Windows paths, with a licence.
Riskno signals detected in the scan
Files in this package
1
Scripts
0
HTML comments
0
URLs in SKILL.md
1
Deprecation

No signals detected. Repository changed on 01.10.2026, without references to retired models or APIs.

Licence

MIT, open: use and modify while retaining author attribution.

What it does and when to use it

Expert npm package manager assistance covering package.json, lockfiles, workspaces (monorepos), scripts, and security audits. Use when managing JavaScript/Node.js dependencies and publishing packages.

Original author description

Expert npm package manager assistance covering package.json, lockfiles, workspaces (monorepos), scripts, and security audits. Use when managing JavaScript/Node.js dependencies and publishing packages.

How it works

  1. When to Use
  2. Quick Start
  3. Core Concepts
  4. Common Patterns
  5. Best Practices
  6. Troubleshooting
  7. References
Original SKILL.md headings · 117 lines, 467 words
SKILL.md preview
---
name: npm
description: Expert npm package manager assistance covering package.json, lockfiles, workspaces (monorepos), scripts, and security audits. Use when managing JavaScript/Node.js dependencies and publishing packages.
---

# npm

npm is the default package manager for Node.js, providing dependency resolution, workspace management, security auditing, and publishing workflows for JavaScript ecosystems.

## When to Use

- **JavaScript / TypeScript Package Management**: Installing, publishing, and managing npm modules and dependencies.
- **Multi-Package Monorepos (npm Workspaces)**: Coordinating interconnected local packages with unified dependency resolution.
- **Supply Chain Security & Provenance**: Publishing packages with cryptographically verifiable build provenance.
- **Vulnerability Auditing & Dependency Overrides**: Resolving transitively vulnerable packages using `overrides`.

## Quick Start

```bash
npm init -y
npm install lodash
npm install --save-dev jest

# Monorepo
npm init -w packages/my-lib
```

## Core Concepts

### Configuring npm Workspaces in Monorepos

Declaring multi-package structures in root `package.json`:

```json
{
  "name": "enterprise-monorepo",
  "private": true,
  "workspaces": ["packages/*", "apps/*"],
  "scripts": {
    "build": "npm run build --workspaces --if-present",
    "test": "npm test --workspaces --if-present"
  },
  "overrides": {
    "glob": "^10.4.0",
    "semver": "^7.6.0"
  }
}
```

### Clean Installations & Deterministic Lockfiles

Installing dependencies in continuous integration:

```bash
# Clean install adhering strictly to package-lock.json (never mutates lockfile)
npm ci

# Audit dependencies for known CVEs
npm audit --audit-level=high

# Run targeted script across all workspaces
npm run test --workspace=packages/core-utils
```

### Publishing Packages with Cryptographic Provenance

Publishing to the npm registry with supply-chain verification:

```bash
# Publish package with Sigstore verifiable provenance
npm publish --access public --provenance
```

## Common Patterns

### Monorepo Workspaces Configuration

**Problem**: Managing shared libraries across multiple internal packages without publishing to external registries.

**Solution**:
Use native npm workspaces in root `package.json`:

```json
{
  "name": "my-monorepo",
  "private": true,
  "workspaces": ["packages/*", "apps/*"],
  "scripts": {
    "build": "npm run build --workspaces --if-present",
    "test": "npm test --workspaces"
  }
}
```

## Best Practices

**Do**:

- Always use `npm ci` in CI/CD pipelines instead of `npm install` to enforce exact lockfile dependencies.
- Publish public packages with `--provenance` to establish cryptographic build transparency.
- Use `overrides` in root `package.json` to resolve security vulnerabilities in deep transitive dependencies.
- Commit `package-lock.json` to version control in all projects.

**Don't**:

- Use `npm install --force` or `--legacy-peer-deps` in production builds; resolve peer version conflicts cleanly.
- Publish packages containing sensitive files; maintain an explicit `.npmignore` or `"files"` whitelist.
- Execute untrusted scripts during install without verifying packages (`npm install --ignore-scripts`).

## Troubleshooting

| Error                                                  | Cause                                                                    | Solution                                                                    |
| :----------------------------------------------------- | :----------------------------------------------------------------------- | :-------------------------------------------------------------------------- |
| `npm ERR! code ERESOLVE: could not resolve dependency` | Peer dependency version conflict.                                        | Run `npm install --legacy-peer-deps` or align conflicting package versions. |
| `npm ERR! code EACCES: permission denied`              | Installing global packages without permissions on system node directory. | Configure user npm prefix: `npm config set prefix ~/.npm-global`.           |
| `package-lock.json out of sync`                        | Dependencies installed with different npm major versions.                | Delete `node_modules` and run `npm ci` for strict deterministic installs.   |

## References

- [npm Documentation](https://docs.npmjs.com/)

Versions

RepositoryScoreLicence
This page · G1Joshi/Agent-Skills100MIT
intentic/intentic90MIT

Database snapshot: 13.11.2026 · package version b9c504de5cee (SHA-256 digest of the entire package)

Downloads in the last 30 days: 0 · ranking

Report a problem with this skill: harmful content, incorrect descriptions or an author’s removal request.

Similar skills

  • 90npm-workspaces # prettier-ignore
    Use when managing npm workspaces monorepos - package dependencies, build ordering, cross-package development, and publishing workflows
  • 95package-management
    Use when choosing or configuring JavaScript/TypeScript package managers, managing dependencies, setting up workspaces, or publishing packages. Covers npm, yarn, pnpm, and bun. USE FOR: package manager selection, npm/yarn/pnpm/bun configuration, monorepo workspaces, dependency…
  • 100bun-package-manager
    Use when managing dependencies with Bun's package manager. Covers installing packages, workspaces, lockfiles, and migrating from npm/yarn/pnpm to Bun.
  • 100uv-workspaces
    Manage multi-package Python projects with uv workspaces. Use when the user mentions uv workspaces, Python monorepo, shared lockfiles, or member dependencies.
  • 98monorepo-management
    Monorepo tooling, task orchestration, and workspace architecture for JavaScript/TypeScript repositories. Use when setting up Turborepo, Nx, pnpm workspaces, or npm workspaces; designing package boundaries; configuring remote caching; optimizing CI for affected packages; managing…
  • 90monorepo-workspaces
    Run a JavaScript/TypeScript monorepo with workspaces, task orchestration, and internal package versioning that scales. Use when managing multiple packages in one repo or when a growing monorepo's builds and installs get slow.

Feedback and reports

Your message goes to Bartosz Sokoliński. An email address is needed only for a reply. See the privacy policy.