autoenv icon indicating copy to clipboard operation
autoenv copied to clipboard

Odd behavior with nvm installed

Open kingofsevens opened this issue 4 years ago • 3 comments

I am using the git version where #189 merged. And I am also using nvm with .nvrmc in some folders with or without .env in them.

When I cd to a folder with .nvmrc defined with a node version in it and it is different from the default version. I see the below outcome.

~/yyy $ cd dev
Found '/Users/xxx/yyy/dev/.nvmrc' with version <12.18.1>
Now using node v12.18.1 (npm v6.14.5)
shasum: Now using node v10.19.0 (npm v6.13.4): 
autoenv_source:.:6: no such file or directory: Now using node v10.19.0 (npm v6.13.4)
shasum: Reverting to nvm default version: 
autoenv_source:.:6: no such file or directory: Reverting to nvm default version
~/yyy/dev $

Even though I receive the above error, nvm uses the correct version.

~/yyy/dev $ node --version
v12.18.1
~/yyy/dev $ cd ..
Reverting to nvm default version
Now using node v10.19.0 (npm v6.13.4)
~/yyy $ node --version
v10.19.0

And no error reverting to old version when changing to parent folder.

kingofsevens avatar Jun 25 '20 17:06 kingofsevens

Having the same issue 😢

jadenlemmon avatar Oct 06 '21 15:10 jadenlemmon

Hmm, I just tried to repo, but unfortunately, I did not get the same issue

I have an empty directory with .nvmrc containing v16.0.0, with the default nvm version being v12.18.1. cd'ing into the directory does nothing. I have to use nvm use to actually change the version

$ nvm use
Found '/.../repos/Groups/Bash/autoenv/.hidden/dir/.nvmrc' with version <v16.0.0>
Now using node v16.0.0 (npm v7.10.0)

Is anyone using nvm in a special way? I checked and it seemed that by default, it does not change the node verison when cding. So I'm not sure how you end up getting your error by default - do you define cd or chdir yourself in your ~./bashrc before sourcing nvm or autoenv?

hyperupcall avatar Apr 08 '22 03:04 hyperupcall

I'm having the same issue. I have nvm automatically loading the defined version of node in my .zshrc file set up. In my .env file of my project i also have source env/bin/activate. This produces the following:

Found '/Users/mprzybylski/Work/patientpattern/.nvmrc' with version <17.9.0>
Now using node v17.9.0 (npm v8.5.5)
shasum: Now using node v16.13.0 (npm v8.1.0): No such file or directory
autoenv_source:.:6: no such file or directory: Now using node v16.13.0 (npm v8.1.0)
shasum: /Users/mprzybylski/Work/patientpattern/.envReverting to nvm default version: No such file or directory
autoenv_source:.:6: no such file or directory: /Users/mprzybylski/Work/patientpattern/.envReverting to nvm default version

reintroducing avatar Jun 26 '22 15:06 reintroducing