The Step runs npm with the command and arguments you provide, for example, to install missing packages or run a package's test.
You can install missing JS dependencies with this Step if you insert it before any build step and provide the install command.
You can also test certain packages with the test command.
You can do both in one Workflow, however, this requires one Run npm command Step for installation followed by another Run npm command Step for testing purposes.
The Step uses corepack to manage the npm version. There are two ways to pin the version:
packageManager field in package.json: Add "packageManager": "[email protected]" to your package.json. The Step will enable corepack, which automatically enforces this version when npm is called.npm_version input: Set the Version of npm to use input to an exact version number (e.g. 10.2.0). This takes priority over the packageManager field and installs that specific version via corepack prepare.If neither is set, the Step runs npm as-is without changing the version.
install to run npm install in the The npm command with arguments to run input.packageManager field in package.json or the Version of npm to use input.Make sure you insert the Step before any build Step so that every dependency is downloaded a build Step starts running.