From 6f404398ce1aedd3ca87957ff63475a0a26017a3 Mon Sep 17 00:00:00 2001 From: sorrycc Date: Thu, 12 Dec 2024 17:19:06 +0800 Subject: [PATCH] docs: suggest using volta to manage node and pnpm version --- docs/docs/docs/introduce/contributing.en-US.md | 6 ++++-- docs/docs/docs/introduce/contributing.md | 6 ++++-- package.json | 4 ++++ 3 files changed, 12 insertions(+), 4 deletions(-) diff --git a/docs/docs/docs/introduce/contributing.en-US.md b/docs/docs/docs/introduce/contributing.en-US.md index 22549218dd3f..fee6c9b249b8 100644 --- a/docs/docs/docs/introduce/contributing.en-US.md +++ b/docs/docs/docs/introduce/contributing.en-US.md @@ -14,9 +14,11 @@ translated_at: '2024-03-17T09:56:34.842Z' Developing Umi requires Node.js 18+ and `pnpm` v8. -It is recommended to use [`nvm`](https://github.com/nvm-sh/nvm) to manage Node.js versions to avoid permission issues and easily switch between Node.js versions. Windows developers can use [`nvm-windows`](https://github.com/coreybutler/nvm-windows). +It's recommended to use [Volta](https://volta.sh/) to manage the node and pnpm version. And you need to set the `VOLTA_FEATURE_PNPM` environment variable to enable pnpm support. -Install `pnpm` via one of the methods on its [official website](https://pnpm.io/installation). +```bash +export VOLTA_FEATURE_PNPM=1 +``` ### Clone the Project diff --git a/docs/docs/docs/introduce/contributing.md b/docs/docs/docs/introduce/contributing.md index 164c7f602fe5..bca8fa09b2ee 100644 --- a/docs/docs/docs/introduce/contributing.md +++ b/docs/docs/docs/introduce/contributing.md @@ -13,9 +13,11 @@ toc: content 开发 Umi 需要 Node.js 18+ 和 `pnpm` v8。 -推荐使用 [`nvm`](https://github.com/nvm-sh/nvm) 管理 Node.js,避免权限问题的同时,还能够随时切换当前使用的 Node.js 的版本。在 Windows 系统下的开发者可以使用 [`nvm-windows`](https://github.com/coreybutler/nvm-windows)。 +推荐使用 [Volta](https://volta.sh/) 来管理 Node.js 和 pnpm 版本。并且需要设置 `VOLTA_FEATURE_PNPM` 环境变量来启用 pnpm 支持。 -在 `pnpm` 的[官网](https://pnpm.io/installation)选择一种方式安装即可。 +```bash +export VOLTA_FEATURE_PNPM=1 +``` ### Clone 项目 diff --git a/package.json b/package.json index 23501db0a4e4..e14b2397af7b 100644 --- a/package.json +++ b/package.json @@ -123,6 +123,10 @@ "node": ">=14", "pnpm": "^8.11.0" }, + "volta": { + "node": "20.18.1", + "pnpm": "8.15.9" + }, "//": { "why-overrides-parcel-watcher": "https://github.com/parcel-bundler/watcher/issues/156", "why-overrides-browserslist": "See scripts/bundleDeps.ts"