Previously it was gently-rming it's target before making a new target
directory. gently-rm vacuums, removing empty directories. This was fine
until you run more than one `link` command concurrently, at which point it's
entirely possible for one invocation to `mkdir` the directory, then
immediately have another one `gently-rm` it, at which point the symlink
fails. Races!
PR-URL: https://github.com/npm/npm/pull/15900
Credit: @iarna
actions: Allow actions to return promises
extract: Eliminate extra callback
finalize: Rewrite finalize as promises
update-linked: Remove update-linked action
install: Remove obsolete invalid action filtering
fetch-package-metadata: Error on installing windows paths on non-windows systems
fetch-package-metadata: Read in modules installed inside of new links
finalize: Act on realpaths because we may be installing inside a link prior to the symlink being made
finalize: Create symlinks of directory deps
deps: Resolve ambiguity for file specifiers in the traditional way
deps: Set link and realpath properties for directory deps
inflate-bundled: Distinguish published bundles from lined modules
node: Add new fromLink attribute to track sourced-to-symlinks deps
diff-trees: Don't try to install deps that are already inside a link
fetch-package-metadata: Improve error messages for link failures
install: Run preinstall lifecycle after finalize
finalize: Start reading package.json files here
decompose-actions: Don't fetch or extract links
deps: Determine if a link matches spec based on where it points
deps: Compute correct save specifier for file spec
deps: Set the isInLink property on new children
deps: When finding the install location, don't walk up out of a symlink unless PRESERVE_SYMLINKS is on
diff-trees: Stop setting isInLink, this is now a first class property
diff-trees: Only exclude children of links from adding if they were already there behind the symlink
inflate-bundled: We are using isInLink now not fromLink
inflate-bundled: realpaths should be built on realpaths
node: Eliminate fromLink as a thing
node: Fill in values for inLink, isInLink & fromBundle
save: When updating a lock/shrinkwrap don't read the damn tree again
shrinkwrap: Fill in version per the new shrinkwrap spec
install: Make _inBundle purely a debugging artifact
inflate-shrinkwrap: Fix how bundle deps are inflated
save: Detect dependency type when saving
recalculateMetadata: Rewrite as simpler and synchronous
prune: Work off computed metadata
refreshPackageJson: Copy all of the in memory version over the on-disk version except empty items
install: Reduce normalize tree function to minimum
realize-package-specifier: Bring into closer alignment with spec
read-shrinkwrap: Use child.isTop not !child.parent
copy-tree: Don't crash of requires or requiredBy are missing
copy-tree: Initialize copied nodes
dedupe: use getRequested instead of child.package._requested
install: recompute the pkg relationships after finalize
Neccessary to align behavior with shrinkwraps where relationship information
isn't available until we read the module off disk.
install: Prune the tree after building it
install: Only save deps if we made changes
inflate-shrinkwrap: Better metadata while inflating