Determine dependencies of another port
ryandesign at macports.org
Tue Jul 20 19:51:03 UTC 2021
On Jul 15, 2021, at 05:26, Haren Samarasinghe wrote:
> I'm trying to write an NPM portgroup, part of which involves setting the
> correct version of npm and the corresponding version of nodejs as a
> port's dependencies.
An npm portgroup is a good idea if we ever want npm-based software to (re-)appear in MacPorts. The lack of this is why I couldn't update my coffee-script port for years and it was ultimately removed.
Making such a portgroup seemed difficult due to the need to track all of the dependencies and their versions, a task for which MacPorts was not designed. However we now have the cargo portgroup which does a similar task so maybe those methods can be adapted for npm.
Back when node and npm were new and backward-incompatible changes were frequent there was a great need to be able to specify which node and npm version to use. If that need continues to exist and you plan to build node and npm version selection into the npm portgroup, then I think it would be nearly unworkable not to also change the node and npm ports so that the different versions don't conflict with one another; that's https://trac.macports.org/ticket/63035.
More information about the macports-dev