Hi there. I have a lot of repos, each with own .nvmrc file where projects nodejs version mentioned
Currently, when working with cursor agent mode when it is running commands of node or npm it uses v 16 (just default of nvm)
When cursor runs project build, or tests, it is almost always run it in wrong node version, so each time I need to stop, and remind it to use nvm use 22
I have a rule for that, but it kind of randomly ignore.
How you deal with that? especially, when you add few projects with different node version to workspace. it becomes more challanging.
If you have the version in .nvmrc then you just need to instruct the agent to always run nvm use first in the local dir - you can do that through CLAUDE.md (need to turn that on in the agent settings) or the custom instructions (also in settings).
I personally have a CLAUDE.local.md file in my repo, that simply says:
# Running scripts in the terminal
- after cd'ing into the project directory, always make sure to run `nvm use` to select the right version of Node
For me this works - when Agent wants to run some shell script, it will then do