pnpm / pnpm.io

pnpm's website
https://pnpm.io
MIT License
211 stars 475 forks source link

Compatibility Issue between Node.js v16 and pnpm v9 when Using pnpm env Command #527

Open blazeshomida opened 4 months ago

blazeshomida commented 4 months ago

Description: I recently encountered a compatibility issue while attempting to utilize the pnpm env command with pnpm version 9 to manage Node.js versions.

Context: I am currently using pnpm version 9. However, when trying to switch to Node.js version 16 using the command pnpm env use --global 16, I faced an unexpected error. Despite my expectation that the pnpm env command would seamlessly handle version switching, it seems there's an compatibility issue between pnpm version 9 and Node.js version 16.

Error Encountered: Executing pnpm env use --global 16 resulted in the following error message on subsequent pnpm commands:

ERROR: This version of pnpm requires at least Node.js v18.12
The current version of Node.js is v16.20.2
Visit https://r.pnpm.io/comp to see the list of past pnpm versions with respective Node.js version support.

Resolution Attempted: In response to the error, I attempted to resolve the issue by installing a separate instance of Node.js thorugh Homebrew (which is what I used to install pnpm) as suggested. However, this workaround goes against the intended purpose of using pnpm env for managing Node.js versions, as it required manual intervention to address the compatibility discrepancy.

Request for Clarification: I apologize for any oversight on my part and acknowledge that this issue might be attributed to user error, such as not thoroughly considering compatibility before attempting to switch versions. I seek clarification regarding the compatibility between pnpm version 9 and Node.js version 16, particularly concerning the usage of the pnpm env command. Additionally, I am eager to learn if there are alternative resolutions or best practices for managing Node.js versions seamlessly with pnpm version 9, especially for users requiring compatibility with Node.js version 16.

This compatibility issue presents a challenge in maintaining a smooth development environment and may impact others facing similar configurations. I am grateful for any insights or guidance provided to address this compatibility concern effectively.