Skip to content
This repository has been archived by the owner on Dec 6, 2023. It is now read-only.

avn could not activate node #47

Open
1 task done
assimovt opened this issue Sep 9, 2016 · 9 comments
Open
1 task done

avn could not activate node #47

assimovt opened this issue Sep 9, 2016 · 9 comments

Comments

@assimovt
Copy link

assimovt commented Sep 9, 2016

I know this has been already discussed, but I am still bumping into this:

$ cd test/
avn could not activate node 5.12.0
$ cat .node-version
5.12.0
$ nvm list
       v0.10.46
       v0.12.15
        v5.12.0
->       v6.5.0
default -> 6.5.0 (-> v6.5.0)
node -> stable (-> v6.5.0) (default)
stable -> 6.5 (-> v6.5.0) (default)
iojs -> N/A (default)
lts/* -> lts/argon (-> N/A)
lts/argon -> v4.5.0 (-> N/A)

Details

  • avn 0.2.3
  • node v6.5.0
  • nvm 0.31.7
  • bash GNU bash, version 4.3.30(1)-release (x86_64-pc-linux-gnu)

The output of __avn_debug in the directory with a .node-version file is:

avn could not activate node 5.12.0
error: no plugin passed predicate
  avn-nvm: Bad argument

avn is loaded in my ~/.bash_profile file with:

export NVM_DIR="$HOME/.nvm"
[ -s "$NVM_DIR/nvm.sh" ] && . "$NVM_DIR/nvm.sh"
[[ -s "$HOME/.avn/bin/avn.sh" ]] && source "$HOME/.avn/bin/avn.sh" # load avn

nvm specific

  • As an nvm user I am confirming that I did not install with Homebrew
@hiimtaylorjones
Copy link

@assimovt have you taken a look at #25? What solutions have you tried and did they get you anywhere?

@assimovt
Copy link
Author

@hiimtaylorjones Yep, I did look at it and done everything as described, but nothing helped. Any other ideas?

@wbyoung
Copy link
Owner

wbyoung commented Sep 19, 2016

The closest environment in which I can attempt to reproduce this has only this change:

  • bash GNU bash, version 4.4.0(1)-release (x86_64-apple-darwin15.6.0)

Everything's working as expected, though.

If you're open to it, the best way to resolve this would be to start adding debugging output to the code (you can edit it right in ~/.avn, specifically ~/.avn/plugins/avn-nvm and running __avn_debug (if you're editing shell files you'll need to re-source ~/.avn/bin/avn.sh as well).

@assimovt
Copy link
Author

@wbyoung sure, let's debug it. I am actually running it in Docker container, based on buildpack-deps:jessie. Please let me know what lines to edit.

@wbyoung
Copy link
Owner

wbyoung commented Sep 19, 2016

Start here. That file is pretty small, so if the error is in there, it shouldn't be too hard to understand & track down. You may need to log to a file if nothing shows up using console, but you may be fine.

@assimovt
Copy link
Author

@wbyoung Alright. Thanks for the tip. I found the problem. The SHELL is not set in the Docker image and the line here https://github.com/wbyoung/avn-nvm/blob/master/index.js#L23 fails. Maybe would be good to add it to the doc or handle error nicely? What do you think? Cheers.

@wbyoung
Copy link
Owner

wbyoung commented Sep 19, 2016

Yeah, both sound smart. Want to send a PR?

@assimovt
Copy link
Author

I am not familiar with the internals, however is this a good place where we could check if SHELL is set? avn.sh#L9

@wbyoung
Copy link
Owner

wbyoung commented Sep 21, 2016

Yes.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants