When creating a react app via "npx create-react-app [app_name]" I noticed the console log something like [#############] idealTree:[package-name]... and then the same thing with "reify" instead of "idealTree". When I search what these terms mean I only see questions relating to package installations failing.
What do "idealTree" and "reify" mean in the context of npm?
The idealTree
meaning is explained in the npm source code file validate-lockfile.js:
// compares the inventory of package items in the tree
// that is about to be installed (idealTree) with the inventory
// of items stored in the package-lock file (virtualTree)
An idealTree
is just the tree that is about to be installed.
In common language reify means:
make (something abstract) more concrete or real.
Reification is then the process or result of reifying.
In the context of npm, we can deduce the meaning from the npm source code file tree-types.md:
During reification, the
idealTree
is diffed against the actual tree, and then the nodes from the ideal tree are extracted onto disk.
In the context of npm, we can say that reify means making the idealTree concrete.
This explains a lot, but why do they take so much time? It doesn't seem to me it'd need this huge amount to time to accomplish. –
Betseybetsy
@NianyiWang Welcome to the word of modern JS development ;) –
Christianson
Especially with
npm ci
I'd expect npm to be able to look at the lockfile and construct an entire tree in sub-seconds. –
Kaki © 2022 - 2024 — McMap. All rights reserved.
npm install
. – Strabismus