From 5a4dbe0c42ab0e62de740dc0f87ebdd07012069f Mon Sep 17 00:00:00 2001 From: HonkingGoose <34918129+HonkingGoose@users.noreply.github.com> Date: Fri, 5 Feb 2021 18:48:42 +0100 Subject: [PATCH 1/3] docs: explain how to specify which npm version Renovate bot uses --- docs/usage/node.md | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/docs/usage/node.md b/docs/usage/node.md index c34a78a5b2824f..b43ad5aded470a 100644 --- a/docs/usage/node.md +++ b/docs/usage/node.md @@ -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. + +You must use the `engines.npm` property in your `package.json` file to specify which major version of npm your project supports. +Renovate bot will then use that version of npm when it creates a pull request. + +In your `package.json` create a `engines` key-value pair and specify which major version of npm your project works with. + +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" + } +} +``` From 2a6c48493dc4b31d5b22e6b2ddd41764d6067826 Mon Sep 17 00:00:00 2001 From: HonkingGoose <34918129+HonkingGoose@users.noreply.github.com> Date: Fri, 5 Feb 2021 18:56:31 +0100 Subject: [PATCH 2/3] add missing word --- docs/usage/node.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/usage/node.md b/docs/usage/node.md index b43ad5aded470a..670d3d2facc0f2 100644 --- a/docs/usage/node.md +++ b/docs/usage/node.md @@ -63,7 +63,7 @@ There is no configuration option to tell Renovate to use the npm version that co You must use the `engines.npm` property in your `package.json` file to specify which major version of npm your project supports. Renovate bot will then use that version of npm when it creates a pull request. -In your `package.json` create a `engines` key-value pair and specify which major version of npm your project works with. +In your `package.json` file create a `engines` key-value pair and specify which major version of npm your project works with. 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: From c619d4e1abb6fa60e46acefd4d0e3f0e70e52f82 Mon Sep 17 00:00:00 2001 From: HonkingGoose <34918129+HonkingGoose@users.noreply.github.com> Date: Sat, 6 Feb 2021 12:50:24 +0100 Subject: [PATCH 3/3] Apply suggestions from code review Co-authored-by: Rhys Arkins --- docs/usage/node.md | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/docs/usage/node.md b/docs/usage/node.md index 670d3d2facc0f2..b665bfb1fbb384 100644 --- a/docs/usage/node.md +++ b/docs/usage/node.md @@ -58,12 +58,10 @@ For additional language support see the [`supportPolicy` documentation](/configu ## 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. +When `binarySource=docker`, such as in the hosted WhiteSource Renovate App, Renovate will choose and install an `npm` version dynamically. -You must use the `engines.npm` property in your `package.json` file to specify which major version of npm your project supports. -Renovate bot will then use that version of npm when it creates a pull request. - -In your `package.json` file create a `engines` key-value pair and specify which major version of npm your project works with. +To control which version or constraint is installed, you should use the `engines.npm` property in your `package.json` file. +Renovate bot will then use that version constraint for npm when it creates a pull request. 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: