Link dependencies being mishandled when installing from git #3918
Labels
Bug
thing that needs fixing
Priority 1
high priority issue
Release 8.x
work is associated with a specific npm 8 release
(Continuing from #3123, as the current issues in the referenced reproduction case are a different problem.)
Re: https://github.com/ioBroker/ioBroker.js-controller
Running this command:
in an empty project raises several issues related to
Link
deps that don't have targets at the time that rebuild and calcDepFlags are run. It seems like this is a simple matter of adding some checks in Arborist to guard against a Link node that doesn't have a target. (Alternatively, we need to makeLink
objects have a fallback so thatlink.target
will refer to the link itself, like it does forNode
objects. If we go that route, we have somenode.isLink
checks which then recurse to thenode.target
and will cause infinite loops, so that will have to be guarded against instead. Not sure offhand which is the less complex/dangerous approach.)Once the checks are added, however, the story gets even more interesting.
Running
npm i ioBroker/ioBroker.js-controller
seems to work. Runningnpm i ioBroker/ioBroker.js-controller
a second time, works again. Runningnpm i ioBroker/ioBroker.js-controller
a third time fails horribly, with many packages not being found.My suspicion is that this is related to the issue highlighted in npm/arborist#299, where lifecycle scripts of locally linked dependencies are not run on first install.
Posted here because I'm not 100% sure this is an Arborist issue, but once it has been root caused, it seems like a good idea to post an issue over on https://github.com/npm/arborist with a more in-the-weeds description and fix.
The text was updated successfully, but these errors were encountered: