Is there an existing issue for this?
Current Behavior
Running npm install --omit=dev in a workspace monorepo with install-strategy=linked crashes:
npm warn reify The "linked" install strategy is EXPERIMENTAL and may contain bugs.
npm error Cannot read properties of undefined (reading 'isProjectRoot')
Without --omit=dev, install works fine.
Expected Behavior
Should install only production dependencies without crashing.
Steps To Reproduce
mkdir -p /tmp/repro/packages/my-lib && cd /tmp/repro
cat > package.json << 'EOF'
{
"name": "my-monorepo",
"private": true,
"workspaces": ["packages/*"],
"dependencies": {
"abbrev": "^2.0.0"
},
"devDependencies": {
"semver": "^7.6.0"
}
}
EOF
cat > packages/my-lib/package.json << 'EOF'
{
"name": "my-lib",
"version": "1.0.0",
"dependencies": {
"abbrev": "^2.0.0"
},
"devDependencies": {
"lru-cache": "^10.0.0"
}
}
EOF
echo "install-strategy=linked" > .npmrc
npm install --omit=dev # crashes
npm install # works fine
Root Cause
addOmitsToTrashList in reify.js iterates idealTree.inventory and reads node.top.isProjectRoot. With linked strategy, createIsolatedTree() in isolated-reifier.js builds proxy node objects — but the workspace and workspace link proxies are missing the top property entirely, so accessing top.isProjectRoot throws.
Note: this is v10-only. npm 11 removed addOmitsToTrashList and moved omit handling into the diff calculation.
Environment
- npm: 10.9.5
- Node.js: 22.20.0
- OS Name: macOS (Darwin 25.3.0)
- npm config:
Is there an existing issue for this?
Current Behavior
Running
npm install --omit=devin a workspace monorepo withinstall-strategy=linkedcrashes:Without
--omit=dev, install works fine.Expected Behavior
Should install only production dependencies without crashing.
Steps To Reproduce
Root Cause
addOmitsToTrashListinreify.jsiteratesidealTree.inventoryand readsnode.top.isProjectRoot. With linked strategy,createIsolatedTree()inisolated-reifier.jsbuilds proxy node objects — but the workspace and workspace link proxies are missing thetopproperty entirely, so accessingtop.isProjectRootthrows.Note: this is v10-only. npm 11 removed
addOmitsToTrashListand moved omit handling into the diff calculation.Environment
install-strategy=linked