nodejs plugin doesn't set npm path for custom node version
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Snapcraft |
Triaged
|
Medium
|
Unassigned |
Bug Description
The nodejs plugin allows a developer to specify a specific version of node to be used (which I needed to do because electron-packager needs at least 10.12 and the default is 8.10). E.g.
parts:
my-part:
plugin: nodejs
nodejs-version: 12.18.2
When I set a custom node version as above, I can see the build.snapcraft.io build server downloading node-v12.
After getting advice from ogra in IRC I managed to work around this by manually setting the path in overide-build:
PATH=$PATH:
Full build log here: https:/
summary: |
- nodejs plugin doesn't use requested node version + nodejs plugin doesn't set npm path for custom 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.