Skip to content

Package Manager Detection

Quick Start: Sequant automatically detects your project’s package manager (npm, Bun, Yarn, or pnpm) from lockfiles and uses the correct commands throughout the workflow. No configuration required.

During sequant init, the package manager is detected from your lockfile:

LockfileDetected PM
bun.lockb / bun.lockBun
yarn.lockYarn
pnpm-lock.yamlpnpm
package-lock.jsonnpm
No lockfilenpm (default)

The detected package manager is stored in .sequant-manifest.json and used for all subsequent commands.

Simply run init - detection happens automatically:

Terminal window
sequant init

Output shows the detected package manager:

📋 Stack: nextjs
📦 Package Manager: bun

Check your manifest to see the stored package manager:

Terminal window
cat .sequant-manifest.json | jq .packageManager

Sequant uses the correct commands for each package manager:

Package ManagerRun ScriptExecute PackageInstall AllAdd PackageRemove PackageUpdate Package
npmnpm run <script>npx <pkg>npm installnpm install <pkg>npm uninstall <pkg>npm update <pkg>
Bunbun run <script>bunx <pkg>bun installbun add <pkg>bun remove <pkg>bun update <pkg>
Yarnyarn <script>yarn dlx <pkg>yarn installyarn add <pkg>yarn remove <pkg>yarn upgrade <pkg>
pnpmpnpm run <script>pnpm dlx <pkg>pnpm installpnpm add <pkg>pnpm remove <pkg>pnpm update <pkg>
  • Worktree setup: When creating feature worktrees, Sequant runs the correct install command
  • Post-update: After sequant update, dependencies are reinstalled with the correct PM
  • Hook detection: Test and build failure detection in hooks works with all package managers
  • CLI messages: Version update suggestions, uninstall hints, and dependency install errors use your package manager’s commands (e.g., pnpm update sequant instead of npm update sequant)

If multiple lockfiles exist (rare), Sequant uses this priority:

  1. Bun (bun.lockb, bun.lock)
  2. Yarn (yarn.lock)
  3. pnpm (pnpm-lock.yaml)
  4. npm (package-lock.json)

If you switch package managers:

  1. Delete old lockfile
  2. Create new lockfile with your new PM
  3. Re-run sequant init (or manually edit manifest)
Terminal window
# Example: Switch from npm to Bun
rm package-lock.json
bun install # Creates bun.lockb
sequant init # Re-detects as Bun

Edit .sequant-manifest.json directly if needed:

{
"version": "0.1.0",
"stack": "nextjs",
"packageManager": "bun",
"installedAt": "2026-01-09T00:00:00.000Z"
}

Use your project’s package manager to install sequant — don’t mix package managers (e.g., don’t run npm install in a pnpm project).

Terminal window
npx sequant init
npx sequant doctor
Terminal window
npm install --save-dev sequant # npm
pnpm add -D sequant # pnpm
yarn add -D sequant # yarn
bun add -D sequant # bun
Terminal window
npm install -g sequant # npm
pnpm add -g sequant # pnpm
yarn global add sequant # yarn
bun add -g sequant # bun

”Cannot read properties of null” when running npm in a pnpm/yarn project

Section titled “”Cannot read properties of null” when running npm in a pnpm/yarn project”

Symptoms: npm update sequant or npm install sequant crashes with Cannot read properties of null (reading 'matches') in a project that uses pnpm or yarn.

Solution: Use your project’s package manager instead of npm. Check which lockfile exists in your project root:

Terminal window
ls pnpm-lock.yaml yarn.lock bun.lockb bun.lock package-lock.json 2>/dev/null

Then use the matching package manager’s commands (see table above).

Symptoms: Sequant uses npm commands but you use Bun/Yarn/pnpm

Solution:

  1. Ensure your lockfile exists in the project root
  2. Re-run sequant init to re-detect
  3. Or manually edit .sequant-manifest.json

Symptoms: Older projects don’t have packageManager field

Solution: This is normal for projects initialized before this feature. Sequant defaults to npm. To update:

Terminal window
# Re-initialize to detect package manager
sequant init
# Or manually add to manifest

Symptoms: bun install or similar fails in feature worktree

Solution: Ensure your package manager is installed globally and in PATH:

Terminal window
# Verify PM is available
bun --version # or yarn/pnpm
Package ManagerVersionNotes
npmAnyDefault, always available with Node.js
Bun1.0+Fast JS runtime and package manager
Yarn1.x, 2.x+Classic and Berry versions
pnpm7.0+Efficient disk space usage

Generated for Issue #6 on 2026-01-10. Updated for Issue #487 on 2026-04-05.