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

Adjust instructions for nvm workaround #1218

Merged

Conversation

kylemh
Copy link
Contributor

@kylemh kylemh commented Nov 26, 2022

I scoured a lot of GitHub issues and Stack Overflow problems. The difficulty in just using:

export NVM_DIR="$HOME/.nvm"
[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh"

is that - by default - nvm.sh will run the default Node version which isn't necessarily the project's node version. This still won't save anybody manually bouncing between Node versions within different projects, but .nvmrc is a very common practice and this should assuage people who run Husky in a project using an .nvmrc file that differs from their NVM default.

@typicode
Copy link
Owner

Thanks for the PR. Out of curiosity, what's the output if you run nvm use in a directory with no .nvmrc?

@kylemh
Copy link
Contributor Author

kylemh commented Dec 13, 2022

Screenshot 2022-12-13 at 7 43 14 PM

It errors, which is why I only run nvm use if the file exists.

@typicode typicode merged commit 16bf08a into typicode:main Apr 26, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants