Run NPM Config

Action ID: npm:config
NPM Package:

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

Description

Runs npm config with the given arguments in the task workspace directory

Input Schema

PropertyTypeDescriptionRequired
argumentsarrayThe arguments to pass to the npm config command

Output Schema

No output schema defined for this action.

Usage Examples

Configure a project-scoped registry for an npm scope

Sets the registry for a specific npm scope in the workspace .npmrc. Use this after fetch:template and before npm:install so scoped packages resolve to your internal registry.

Copy
steps:
  - id: set_scoped_registry
    action: npm:config
    input:
      arguments:
        - set
        - '@${{ parameters.npmScope }}:registry'
        - '${{ parameters.npmRegistryUrl }}'
        - '--location=project'

Add an auth token for a private registry in the project .npmrc

Writes an auth token for a private registry to the workspace .npmrc so dependencies can be installed during scaffolding. Run before npm:install; avoid committing the generated .npmrc.

Copy
steps:
  - id: set_registry_auth_token
    action: npm:config
    input:
      arguments:
        - set
        - '//${{ parameters.npmRegistryHostPath }}:_authToken'
        - '${{ parameters.npmAuthToken }}'
        - '--location=project'