This plugin uses the following plugin-specific keywords:
npm-include-node (bool, default: false)
If true, download and include the node binary and its dependencies. If npm-include-node is true, then npm-node-version must be defined.
npm-node-version (string)
The version of node.js you want the snap to run on and includes npm, as would be downloaded from (https://nodejs.org). If not set, node.js must be provided another way, such as creating a node-deps part that provides node using build and staging dependencies or manually. Search GitHub for examples.
Requires Snapcraft version 8.0+ for core24.
Requires Snapcraft version 7.0+ for core22.
base: core20
This plugin uses the following required plugin-specific keyword:
npm-node-version (string)
The version of node.js you want the snap to run on and includes npm, as would be downloaded from (https://nodejs.org).
The difference there, @bart, is between using core18 vs core20. Plugins were all updated for core20 and the options made more consistently named between plugins.
Edit: oops, I forgot this plugin only works with core20
I’m starting use the npm plugin with base: core20 environment & i’d ask about the node.js versions actually supported and how the default one is handled when no npm-node-version is specified … Actually with the node 16.9.1 version i’ve experimented the following error:
That i think it depends from the npm version in use? Every time i’m trying to add a package i’m running into trouble with the npm plugin and latest node.js versions eg. 16.10.0 …
tried this plugin today. But was a bit confused why node is downloaded as part of the build step?
I have to generate some files using npm before running npm install. But this fails with npm not found because node seems to get installed during the build step, so an override would not work:
override-build: |
npm install
npm run build-latest
snapcraftctl build