Quiet NPM Install

Action ID: npm:install
NPM Package:

@mdude2314/backstage-plugin-scaffolder-npm-actions

Description

Runs npm install quietly with the given package name

Input Schema

PropertyTypeDescriptionRequired
packageToInstallstringName of package to install

Output Schema

No output schema defined for this action.

Usage Examples

Install a fixed runtime dependency during service scaffolding

Installs express version 4.18.2 quietly into the generated Node service after fetch:template and before publish:github. Use this when your template does not include a required package by default.

Copy
steps:
  - id: fetch-base
    action: fetch:template
    input:
      url: https://github.com/acme/templates/node-service
      targetPath: .
      values:
        serviceName: ${{ parameters.name }}
        owner: ${{ parameters.owner }}

  - id: install-express
    action: npm:install
    input:
      packageToInstall: "express@4.18.2"

  - id: publish
    action: publish:github
    input:
      repoUrl: github.com?owner=${{ parameters.owner }}&repo=${{ parameters.name }}

Parameterized install of an optional scoped package

Installs a package chosen by the user during scaffolding using a template parameter, for example “@sentry/node@8” or “@types/jest@29”. This runs after fetch:template and before publish:github.

Copy
steps:
  - id: fetch-lib
    action: fetch:template
    input:
      url: https://github.com/acme/templates/node-library
      targetPath: .
      values:
        packageName: ${{ parameters.packageName }}
        owner: ${{ parameters.owner }}

  - id: install-optional-package
    action: npm:install
    input:
      packageToInstall: "${{ parameters.extraPackage }}"

  - id: publish
    action: publish:github
    input:
      repoUrl: github.com?owner=${{ parameters.owner }}&repo=${{ parameters.packageName }}