Commit 693b9d2ea16 for woocommerce
commit 693b9d2ea164c56260b01224e7d9335f0b291695
Author: Brandon Kraft <public@brandonkraft.com>
Date: Wed Jun 24 12:45:09 2026 -0500
Remove nvm requirement from contributor docs and Blocks build notice (#65850)
* docs: remove nvm requirement from dev docs and Blocks build notice
* chore: add changelog entry for Blocks build notice nvm removal
* docs: add language to repository structure code fence (MD040)
diff --git a/.cursor/rules/woo-build.mdc b/.cursor/rules/woo-build.mdc
index 53e470ecfc4..02ecea867ff 100644
--- a/.cursor/rules/woo-build.mdc
+++ b/.cursor/rules/woo-build.mdc
@@ -14,10 +14,9 @@ Specific dependencies and build instructions are listed in `README.md`.
The commands to build are
```bash
-# Ensure that correct version of Node is installed and being used
-nvm install
-# Install the PHP and Composer dependencies for all of the plugins, packages, and tools
-pnpm install -frozen-lockfile
+# Install the PHP and Composer dependencies for all of the plugins, packages, and tools.
+# PNPM automatically uses the pinned Node version for every script it runs.
+pnpm install --frozen-lockfile
# Build all of the plugins, packages, and tools in the monorepo
pnpm build
```
@@ -37,6 +36,5 @@ This is a development build which ensures experimental features are active.
If there are problems with this command, ensure the dependencies were installed first, but generally unless this is the first build, `pnpm build` does not need to be ran prior.
```bash
-nvm install
-pnpm install -frozen-lockfile
+pnpm install --frozen-lockfile
```
diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md
index 5c864e78332..1cb8999eb59 100644
--- a/CONTRIBUTING.md
+++ b/CONTRIBUTING.md
@@ -4,8 +4,7 @@ This is a quick reference for common commands used during development. For broad
## Tooling
-- [NVM](https://github.com/nvm-sh/nvm#installing-and-updating) (recommended for Node version management)
-- [Node.js](https://nodejs.org/)
+- [Node.js](https://nodejs.org/) (PNPM installs and uses the pinned version automatically; a version manager such as [NVM](https://github.com/nvm-sh/nvm#installing-and-updating) is optional)
- [PNPM](https://pnpm.io/installation)
- [PHP](https://www.php.net/manual/en/install.php)
- [Composer](https://getcomposer.org/doc/00-intro.md)
@@ -16,9 +15,8 @@ A POSIX-compliant OS (Linux, macOS) is assumed. On Windows, use [WSL](https://le
## Initial install
```sh
-# Use the pinned Node version from .nvmrc
-nvm install
-# Install JS and PHP dependencies
+# Install JS and PHP dependencies.
+# PNPM automatically uses the pinned Node version for the scripts it runs.
pnpm install
```
diff --git a/README.md b/README.md
index 37cab3c2a24..ea9f6c1bd1f 100644
--- a/README.md
+++ b/README.md
@@ -12,7 +12,7 @@ To get up and running within the WooCommerce Monorepo, you will need to make sur
### Prerequisites
-- [NVM](https://github.com/nvm-sh/nvm#installing-and-updating): While you can always install Node through other means, we recommend using NVM to ensure you're aligned with the version used by our development teams. Our repository contains [an `.nvmrc` file](.nvmrc) which helps ensure you are using the correct version of Node.
+- [Node.js](https://nodejs.org/): Required to run PNPM and the monorepo's build and test scripts. You do not need to match a specific Node version by hand. PNPM reads the version pinned in [`pnpm-workspace.yaml`](pnpm-workspace.yaml) (`useNodeVersion`, mirrored in [`.nvmrc`](.nvmrc)) and automatically installs and uses it for every script it runs. A Node version manager such as [NVM](https://github.com/nvm-sh/nvm#installing-and-updating) is optional, but still handy for installing Node itself.
- [PNPM](https://pnpm.io/installation): Our repository utilizes PNPM to manage project dependencies and run various scripts involved in building and testing projects.
- [PHP 7.4+](https://www.php.net/manual/en/install.php): WooCommerce Core currently requires PHP version 7.4 or higher. It is also needed to run Composer and various project build scripts. See [troubleshooting](DEVELOPMENT.md#troubleshooting) for troubleshooting problems installing PHP.
- [Composer](https://getcomposer.org/doc/00-intro.md): We use Composer to manage all of the dependencies for PHP packages and plugins.
@@ -22,10 +22,9 @@ Note: A POSIX-compliant operating system (e.g., Linux, macOS) is assumed. If you
Once you've installed all prerequisites, the following will prepare all of the build outputs necessary for development:
```bash
-# Ensure that the correct version of Node is installed and being used
-nvm install
-# Install the PHP and Composer dependencies for all of the plugins, packages, and tools
-pnpm install -frozen-lockfile
+# Install the PHP and Composer dependencies for all of the plugins, packages, and tools.
+# PNPM automatically uses the pinned Node version for every script it runs.
+pnpm install --frozen-lockfile
# Build all of the plugins, packages, and tools in the monorepo
pnpm build
```
diff --git a/docs/getting-started/development-environment.md b/docs/getting-started/development-environment.md
index 1a51c857c88..e8d4ae0c9b6 100644
--- a/docs/getting-started/development-environment.md
+++ b/docs/getting-started/development-environment.md
@@ -11,7 +11,7 @@ sidebar_position: 2
There are some specific software requirements you will need to consider when developing WooCommerce extensions. The necessary software includes:
* [Git](https://git-scm.com/) for version control of your source code
-* [Node.js](https://nodejs.org/) and [nvm](https://github.com/nvm-sh/nvm/blob/master/README.md) to manage node-based scripts and build processes
+* [Node.js](https://nodejs.org/) to run node-based scripts and build processes. PNPM installs and uses the Node version pinned in the repository automatically, so a version manager such as [nvm](https://github.com/nvm-sh/nvm/blob/master/README.md) is optional.
* [Pnpm](https://pnpm.io/) is an npm alternative required if you are building WooCommerce from the repository
* [Composer](https://getcomposer.org/) is an optional dependency management tool for PHP-based development
* [WP-CLI](http://wp-cli.org/) is the command line interface for WordPress
@@ -76,15 +76,11 @@ git clone https://github.com/woocommerce/woocommerce.git
cd woocommerce
```
-#### Install and activate Node
+#### Install Node
-It is recommended to install and activate Node using [Node Version Manager](https://github.com/nvm-sh/nvm) (or nvm). You can install nvm using the following CLI command:
+You need [Node.js](https://nodejs.org/) installed to run PNPM and the build scripts. You do not need to match a specific Node version yourself: PNPM reads the version pinned in `pnpm-workspace.yaml` (`useNodeVersion`, mirrored in `.nvmrc`) and installs and uses it automatically for every script it runs.
-```shell
-nvm install
-```
-
-You can learn more about how to install and utilize nvm in [the nvm GitHub repository](https://github.com/nvm-sh/nvm?tab=readme-ov-file#intro).
+If you would like a tool to install and switch between Node versions, [Node Version Manager](https://github.com/nvm-sh/nvm) (nvm) is one option. With nvm installed, running `nvm install` from the repository root picks up the pinned version from `.nvmrc`. You can learn more in [the nvm GitHub repository](https://github.com/nvm-sh/nvm?tab=readme-ov-file#intro).
#### Install dependencies
diff --git a/packages/js/email-editor/writing-e2e-tests.md b/packages/js/email-editor/writing-e2e-tests.md
index fbceb57cb81..8f8da775c25 100644
--- a/packages/js/email-editor/writing-e2e-tests.md
+++ b/packages/js/email-editor/writing-e2e-tests.md
@@ -13,8 +13,7 @@
1. **Environment Setup**:
```bash
- # From repository root
- nvm use
+ # From repository root (PNPM uses the pinned Node version automatically)
pnpm install
pnpm --filter='@woocommerce/plugin-woocommerce' build
cd plugins/woocommerce
diff --git a/plugins/woocommerce/README.md b/plugins/woocommerce/README.md
index a044ee3bb87..f4167574983 100644
--- a/plugins/woocommerce/README.md
+++ b/plugins/woocommerce/README.md
@@ -14,7 +14,7 @@ If you are not a developer, please use the [WooCommerce plugin page](https://wor
### Quick start
-Ensure your system meets [the requirements](../../README.md#getting-started) (TLDR: NVM, PNPM, PHP 7.4+, Composer are required for development).
+Ensure your system meets [the requirements](../../README.md#getting-started) (TLDR: Node.js, PNPM, PHP 7.4+, and Composer are required for development; NVM is optional, since PNPM uses the pinned Node version automatically).
Depending on the preferred environment for running the development instance of WooCommerce, you might need [Docker](https://docs.docker.com/get-docker/) as well. You can learn more about supported environments [here in the developer docs](https://developer.woocommerce.com/docs/setting-up-your-development-environment/).
diff --git a/plugins/woocommerce/changelog/62695-remove-nvm-from-blocks-build-notice b/plugins/woocommerce/changelog/62695-remove-nvm-from-blocks-build-notice
new file mode 100644
index 00000000000..33907ce18fa
--- /dev/null
+++ b/plugins/woocommerce/changelog/62695-remove-nvm-from-blocks-build-notice
@@ -0,0 +1,3 @@
+Significance: patch
+Type: dev
+Comment: Remove the obsolete `nvm use` step from the WooCommerce Blocks development build admin notice, since PNPM now manages the Node version automatically.
diff --git a/plugins/woocommerce/client/blocks/docs/contributors/getting-started.md b/plugins/woocommerce/client/blocks/docs/contributors/getting-started.md
index aedafe3e943..080aefb79d8 100644
--- a/plugins/woocommerce/client/blocks/docs/contributors/getting-started.md
+++ b/plugins/woocommerce/client/blocks/docs/contributors/getting-started.md
@@ -48,7 +48,7 @@ define( 'SCRIPT_DEBUG', true );
To install dependencies, you will need the following tools installed on your machine:
-- `node` and `npm` via [NVM](https://github.com/nvm-sh/nvm#installing-and-updating): While you can always install Node or NPM through other means, we recommend using NVM to ensure you're aligned with the version used by our development teams. Our repository contains [an `.nvmrc` file](../../.nvmrc) which helps ensure you are using the correct version of Node.
+- [Node.js](https://nodejs.org/) (which includes `npm`): Most monorepo scripts run through PNPM, which installs and uses the Node version pinned in [the `.nvmrc` file](../../.nvmrc) automatically. A version manager such as [NVM](https://github.com/nvm-sh/nvm#installing-and-updating) is optional if you would like help installing or switching between Node versions.
- [PHP](https://www.php.net/manual/en/install.php): WooCommerce Blocks requires PHP. It is also needed to run Composer and various project build scripts.
- [Composer](https://getcomposer.org/doc/00-intro.md): We use Composer to manage all of the dependencies for PHP packages and plugins.
@@ -59,7 +59,7 @@ See [`package.json` `engines`](../../package.json) and [`readme.txt`](../../read
Once you the above setup, install the dependencies from the command line:
- Change directory to your repo folder, e.g. `$ cd woocommerce-blocks`.
-- Ensure the correct version of Node and NPM are installed - `$ nvm use`
+- (Optional) If you manage Node versions with a tool such as nvm, select the pinned version - `$ nvm use`
- Install JavaScript and PHP dependencies - `$ npm install && composer install`.
## Building the plugin files
diff --git a/plugins/woocommerce/src/Blocks/Domain/Bootstrap.php b/plugins/woocommerce/src/Blocks/Domain/Bootstrap.php
index e4180c11475..011ed924201 100644
--- a/plugins/woocommerce/src/Blocks/Domain/Bootstrap.php
+++ b/plugins/woocommerce/src/Blocks/Domain/Bootstrap.php
@@ -185,9 +185,8 @@ class Bootstrap {
function () {
echo '<div class="error"><p>';
printf(
- /* translators: %1$s is the node install command, %2$s is the install command, %3$s is the build command, %4$s is the watch command. */
- esc_html__( 'WooCommerce Blocks development mode requires files to be built. From the root directory, run %1$s to ensure your node version is aligned, run %2$s to install dependencies, %3$s to build the files or %4$s to build the files and watch for changes.', 'woocommerce' ),
- '<code>nvm use</code>',
+ /* translators: %1$s is the install command, %2$s is the build command, %3$s is the watch command. */
+ esc_html__( 'WooCommerce Blocks development mode requires files to be built. From the root directory, run %1$s to install dependencies, %2$s to build the files or %3$s to build the files and watch for changes.', 'woocommerce' ),
'<code>pnpm install</code>',
'<code>pnpm --filter="@woocommerce/plugin-woocommerce" build</code>',
'<code>pnpm --filter="@woocommerce/plugin-woocommerce" watch:build</code>'
diff --git a/plugins/woocommerce/tests/e2e/README.md b/plugins/woocommerce/tests/e2e/README.md
index cff29433e50..c044ed7ec49 100644
--- a/plugins/woocommerce/tests/e2e/README.md
+++ b/plugins/woocommerce/tests/e2e/README.md
@@ -33,8 +33,7 @@ End-to-end tests are powered by Playwright. By default, the test site is spun up
Start in the repository root folder:
-- `nvm use` (uses the default node version you have set in NVM)
-- `pnpm install` (installs dependencies)
+- `pnpm install` (installs dependencies; PNPM uses the pinned Node version automatically)
- `pnpm --filter='@woocommerce/plugin-woocommerce' build` (builds WooCommerce locally)
- `cd plugins/woocommerce` (changes into the WooCommerce plugin folder)
- `pnpm env:start` (starts the `wp-env` based local environment)