Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

docs: explain how to specify which npm version Renovate bot uses #8559

19 changes: 19 additions & 0 deletions docs/usage/node.md
Original file line number Diff line number Diff line change
Expand Up @@ -55,3 +55,22 @@ We recommend that you define this support policy inside the `node` configuration
This way, it is applied to all Node.js-related files.

For additional language support see the [`supportPolicy` documentation](/configuration-options/#supportpolicy).

## Configuring which version of npm Renovate uses

There is no configuration option to tell Renovate to use the npm version that comes pre-installed with Node.

HonkingGoose marked this conversation as resolved.
Show resolved Hide resolved
You must use the `engines.npm` property in your `package.json` file to specify which major version of npm your project supports.
HonkingGoose marked this conversation as resolved.
Show resolved Hide resolved
Renovate bot will then use that version of npm when it creates a pull request.
HonkingGoose marked this conversation as resolved.
Show resolved Hide resolved

In your `package.json` file create a `engines` key-value pair and specify which major version of npm your project works with.

HonkingGoose marked this conversation as resolved.
Show resolved Hide resolved
For example, if you want to use at least npm `6.14.11` and also allow newer versions of npm in the `6.x` range, you would put this in your `package.json` file:

```json
{
"engines": {
"npm": "^6.14.11"
}
}
```
rarkins marked this conversation as resolved.
Show resolved Hide resolved