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

[rush] Issues with Rush and the FNM node version manager. #4983

Open
NovaAstra opened this issue Oct 28, 2024 · 4 comments
Open

[rush] Issues with Rush and the FNM node version manager. #4983

NovaAstra opened this issue Oct 28, 2024 · 4 comments

Comments

@NovaAstra
Copy link

Details

Configure .nvmrc in the root directory, and fnm works normally.
But every time I cd to the subproject, fnm fails to read .nvmrc correctly.
Can I put .nvmrc in common\config\rush so that it can be read globally?

In addition, what bothers me is that every time I install a subproject dependency, I have to switch to the subproject to install the dependency. Can the rush add command be enhanced so that it can be executed in the root directory, just like
pnpm --filter, the corresponding rush can rush add --to

Question Answer
@microsoft/rush globally installed version? 5.140.0
rushVersion from rush.json? 5.14.0
useWorkspaces from rush.json? true
Operating system? Windows
Would you consider contributing a PR? Yes
Node.js version (node -v)? 20.18.0
@iclanton
Copy link
Member

It looks like fnm has an option that would solve your issue called --version-file-strategy=recursive. Can you give that a try? Configuring the node version globally, or in rush-project.json sounds like an interesting enhancement, but you may be able to work around your immediate issue without any changes to Rush.

The enhancements to rush add sound like a good idea.

@NovaAstra
Copy link
Author

NovaAstra commented Oct 29, 2024

It seems to be solved. By setting fnm env to recursively search for .nvmrc in the parent level
fnm env --version-file-strategy=recursive --use-on-cd | Out-String | Invoke-Expression

I really hope to add rush add <dep> --to <package>. It is a bit troublesome for me to cd into the sub-project to install dependencies every time.

@NovaAstra
Copy link
Author

use-node-version=20.17.0 node-version=20.17.0 engine-strict=true

I found some configuration in pnpm, which may be easier to configure

@iclanton iclanton changed the title [rush] fnm [rush] Issues with Rush and the FNM node version manager. Nov 4, 2024
@iclanton iclanton moved this from Needs triage to General Discussions in Bug Triage Nov 4, 2024
@NovaAstra
Copy link
Author

NovaAstra commented Nov 9, 2024

@iclanton
Is there a plan to improve usability in the future?
rush add <dep> --to <package>

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: General Discussions
Development

No branches or pull requests

2 participants