Comments (2)
I've put together an arborist test case to demonstrate the issue: https://github.com/TrevorBurnham/cli/tree/7746-bug-test-case
You can run the test case on that branch with this command:
npm test -w @npmcli/arborist -- test/arborist/reify.js --no-cov -g="parent"
Notably, the test passes if you perform reify
twice: The second reify
restores the indirect dependency that the first reify
deleted,
from cli.
I've submitted a PR that appears to address this issue (at least as far as the test case is concerned): #7752
I'd welcome alternative fix suggestions. I'm new to this codebase, but from what I can tell, here's what's happening when building the ideal tree in the test case:
- The dependency on the deleted node is identified as a problem edge and the information needed to recreate the node is fetched from the registry.
- When the new node is placed on its parent, that edge is now considered satisfied. And since there are already nodes for all of its direct dependencies, all of its edges out are also considered satisfied (i.e. it has no problem edges).
So the problem is that no checks are performed for indirect dependencies of the placed dep. The PR addresses that by adding the placed dep's children to the deps queue, so that they get checked for missing deps.
I'm sure there's a more elegant solution that I'm missing! I'd love to hear any thoughts.
from cli.
Related Issues (20)
- Feature request: Add config option to prevent accidental installation of packages in directories without package.json HOT 2
- [BUG] npm publish <package-spec> in a workspace is not taking package-spec into account HOT 1
- [BUG] package binaries with .hidden folders don't install globally HOT 1
- [BUG] No lifecycle hooks are run at all HOT 3
- [BUG] `npm update -g ds` removes all global packages and npm itself HOT 3
- [BUG] DevDependancy are installed in production when also marked as peerDependenciesMeta optional HOT 3
- [question] Whether it is possible to upload to npmjs.org manually? HOT 1
- [BUG] `npm outdated --json` doesn't provide distinct workspace packages information HOT 1
- [BUG] git dependencies cause weird behaviour when git is not installed HOT 1
- [BUG] DevDependancy are installed in production when also marked as optional peerDependencies HOT 8
- [BUG] outdated does not report packages in unnamed workspaces HOT 1
- [BUG] Inconsistent audit json HOT 3
- [BUG] `npm i` does not set `["packages"][""]["name"]` in package-lock.json when there is no name in package.json while `npm audit fix` sets that to project's directory name HOT 7
- [BUG] The .gitignore file is renamed to .npmignore when npm install HOT 2
- [BUG] The package-lock.json file depends on node_modules, which will cause the lock generated by npm i to be inconsistent after the lock file is deleted when some packages that depend on the system architecture (such as node-unix-socket) are installed again. HOT 3
- Start HOT 1
- [BUG] Project name was being added to dependencies automatically HOT 7
- Align npm packages to npm 10's node engine range
- Problem: CORS Error When Accessing Swagger API Deployed on AWS EC2 HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from cli.