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

🚀 Feature: Use pnpm as a Node.js environment manager #805

Open
3 tasks done
conrmahr opened this issue Sep 5, 2023 · 3 comments
Open
3 tasks done

🚀 Feature: Use pnpm as a Node.js environment manager #805

conrmahr opened this issue Sep 5, 2023 · 3 comments
Labels
status: blocked Waiting for something else to be resolved type: feature New enhancement or request

Comments

@conrmahr
Copy link
Contributor

conrmahr commented Sep 5, 2023

Bug Report Checklist

  • I have tried restarting my IDE and the issue persists.
  • I have pulled the latest main branch of the repository.
  • I have searched for related issues and found none that matched my issue.

Overview

Since the project uses pnpn for installing packages, why not streamline it for Node.js environment installs? This will allow you to built-in a check whether the current environment on the machine matches the recommended version. Along with removing the .nvmrc file.

  1. Check if recommended version exists:
$ pnpm env list

16.20.2
20.6.0
  1. Install and use if not found:
$ pnpm env use 18.17.1

Fetching Node.js 18.17.1 ...
Node.js 18.17.1 is activated
  1. Profit 💵

Additional Info

Official docs: https://pnpm.io/cli/env

@conrmahr conrmahr added the type: feature New enhancement or request label Sep 5, 2023
@JoshuaKGoldberg
Copy link
Owner

It's an interesting idea, thanks for bringing it up @conrmahr! (for context, we'd briefly chatted about this on a Twitch stream today)

Putting as in discussion - I haven't used pnpm env much. One nice thing about .nvmrc is that if you're using nvm then the .nvmrc should have it auto-set your package for you. Is there an equivalent for pnpm?

@JoshuaKGoldberg JoshuaKGoldberg added the status: in discussion Not yet ready for implementation or a pull request label Sep 5, 2023
@conrmahr
Copy link
Contributor Author

conrmahr commented Sep 5, 2023

Good question. It looks like it can use the .npmrc file per-project configuration file with the parameter use-node-version=x.x.x.

📖 https://pnpm.io/npmrc#nodejs-settings

@JoshuaKGoldberg
Copy link
Owner

Coming back to this, I still would really like to get rid of the .nvmrc file. It's irksome to me that we have both the npm-standard package.json "engines" field and some ad hoc script tool config file. My main motivation here is to reduce the number of config files.

I think generally getting rid of .nvmrc is could go with either of:

Either way, blocked for now. 😖

@JoshuaKGoldberg JoshuaKGoldberg added status: blocked Waiting for something else to be resolved and removed status: in discussion Not yet ready for implementation or a pull request labels Feb 5, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
status: blocked Waiting for something else to be resolved type: feature New enhancement or request
Projects
None yet
Development

No branches or pull requests

2 participants