- plugin not registered: 'node' (in field 'parts.app')

I have nodejs project and building its snap, getting this error,

Bad snapcraft.yaml content:

  • plugin not registered: ‘node’ (in field ‘parts.app’)
    Full execution log: ‘/home/boschrexroth/.local/state/snapcraft/log/snapcraft-20231025-082603.582362.log’

and snapcraft.yaml is following version: “1.0.0”

name: new-proj

summary: express project sample written in Node.js.

description: |

Programm is for to ceck express.

confinement: strict

#confinement: devmode

#icon: assets/icons/ICONHERE.png

grade: stable # must be ‘stable’ to release into candidate/stable channels

base: core22

type: app

apps:

app:

command: src/app

daemon: simple

# interfaces to connect to https://snapcraft.io/docs/supported-interfaces

plugs: [network]

restart-condition: always

passthrough:

  restart-delay: 10s

parts:

app:

source: .

build-environment:

  # Set the node version here. We recommend to use the latest LTS version.

  - NODE_VERSION: "18.17.0"

# We don't use the npm plugin here, because it has no X-build capability (can't build arm64 target snaps on amd64).

# plugin: npm

# npm-node-version: "18.17.0"

plugin: node

node-engine: $NODE_VERSION

override-build: |

  # set target arch

  if [ $SNAPCRAFT_TARGET_ARCH == "arm64" ]; then

      arch="arm64"

  else

      arch="x64"

  fi    

  # fetch node

  node_uri="https://nodejs.org/dist/v${NODE_VERSION}/node-v${NODE_VERSION}-linux-${arch}.tar.gz"

  echo fetching: $node_uri

  if [ ! -f "${SNAPCRAFT_PART_INSTALL}/bin/node" ]; then

      curl $node_uri | tar xzf - -C $SNAPCRAFT_PART_INSTALL/ --no-same-owner --strip-components=1

  fi

  # pack and install the app (only production)

  npm install -g --prefix $SNAPCRAFT_PART_INSTALL $(npm pack . | tail -1) --ignore-scripts --omit=dev --no-fund --unsafe-perm

  # remove unused node_modules

  rm -rf ${SNAPCRAFT_PART_INSTALL}/lib/node_modules/npm

  rm -rf ${SNAPCRAFT_PART_INSTALL}/lib/node_modules/corepack

Please check the plugin documentation, IIRC the node plugin got renamed (and changed its options) with core22 bases…

can you please refer me exact documentation link. Thanks