Comment 1 for bug 1886858

Revision history for this message
Oliver Grawert (ogra) wrote : Re: nodejs plugin doesn't use requested node version

this description is a bit off ...

the snapcraft.yaml had something like:

parts:
  my-part:
    plugin: nodejs
    nodejs-version: 12.18.2
    build-packages:
      - nodejs

so the dab packaged node from build-packages got used by default ... (which i think is the correct behaviour)

BUT... when also setting "nodejs-package-manager: npm" and *not* putting -npm into build-packages, then npm is not found and the:

PATH=$PATH:$SNAPCRAFT_PART_SRC/../npm/bin

line is needed in an override-build to make this npm actually used ...

the snapcraft nodejs plugin should properly add "$SNAPCRAFT_PART_SRC/../npm/bin" to the PATH if "nodejs-package-manager: npm" is used.