MCPcopy Create free account
hub / github.com/npm/cli / assertRootOverrides

Method assertRootOverrides

workspaces/arborist/lib/node.js:1390–1402  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

1388 }
1389
1390 assertRootOverrides () {
1391 if (!this.isProjectRoot || !this.overrides) {
1392 return
1393 }
1394
1395 for (const edge of this.edgesOut.values()) {
1396 // if these differ an override has been applied, those are not allowed
1397 // for top level dependencies so throw an error
1398 if (edge.spec !== edge.rawSpec && !edge.spec.startsWith('$')) {
1399 throw Object.assign(new Error(`Override for ${edge.name}@${edge.rawSpec} conflicts with direct dependency`), { code: 'EOVERRIDE' })
1400 }
1401 }
1402 }
1403
1404 addEdgeOut (edge) {
1405 if (this.overrides) {

Callers 4

#loadActualMethod · 0.80
#buildDepsMethod · 0.80
loadVirtualMethod · 0.80
node.jsFile · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected