add npm and update prefix location #1527
Open
+1
−0
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
out of the box
npm
is not installed with nodejs so pipeline cannot be used as of now.prefix was once changed before via prefix should be /usr #863 but if we go with
/usr
thennpm
is not able to detect the installs. It is looking for installed deps under/usr/local/lib/node_modules
but this pipelines installs things under/usr/lib/node_modules
In wolfi, some
npm install
are using-prefix ${{targets.destdir}}/usr/local/
prefix.ref: https://github.com/wolfi-dev/os/blob/16217a5581667f12cc28a592eef03fec13f98ffb/lerna.yaml#L28 and https://github.com/wolfi-dev/os/blob/16217a5581667f12cc28a592eef03fec13f98ffb/renovate.yaml#L29
but some are also using
-prefix ${{targets.destdir}}/usr
ref: https://github.com/wolfi-dev/os/blob/16217a5581667f12cc28a592eef03fec13f98ffb/playwright.yaml#L23
thinking about it from placing binary perspective, it makes sense that we choose
/usr
because we put most binaries in/usr/bin
but if we go with/usr/local
as well then that should be good as well considering it's there in PATH./ # echo $PATH /usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
from libraries perspective, for e.g. while packaging express, we need to use
/usr/local
consideringnpm root -g