Varying-Vagrant-Vagrants / VVV

An open source Vagrant configuration for developing with WordPress
https://varyingvagrantvagrants.org
MIT License
4.54k stars 847 forks source link

Bug: nvm extension doesn't install correctly #2561

Closed theMikeD closed 2 years ago

theMikeD commented 2 years ago

Are you using the latest stable or develop branch version of VVV?

Yes (develop)

Is it a new VVV or an existing VVV that used to work?

New fresh install

Whats the problem?

I enabled the nvm extension:

extensions:
  core: # The core VVV extensions
    - tls-ca # HTTPS SSL/TLS certificates
    - phpmyadmin # Web based database client
    - memcached-admin # Object cache management
    - opcache-status # opcache management
    #- webgrind # PHP Debugging
    #- mongodb # needed for Tideways/XHGui
    #- tideways # PHP profiling tool, also installs xhgui check https://varyingvagrantvagrants.org/docs/en-US/references/tideways-xhgui/
    - nvm # Node Version Manager
    #- php56
    #- php70
    #- php71
    #- php72
    #- php73
    - php74
    #- php80

then destroyed and reprovisioned the VM. When I loggedin, nvm was not available.

vagrant@vvv:~$ command -v nvm
vagrant@vvv:~$

The provisioner displayed the following info:

==> default: Running provisioner: extension-core-nvm (shell)...
    default: Running: /var/folders/hc/3wcb6b495130sm9nmnxgg130000102/T/vagrant-shell20211129-14986-17vgy23.sh
    default:  ▷ Running the 'extension-core-nvm' provisioner...
    default:   % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
    default:                                  Dload  Upload   Total   Spent    Left  Speed
100 13527  100 13527    0     0  99463      0 --:--:-- --:--:-- --:--:-- 98737
    default: Cloning into '/root/.nvm'...
    default: sudo: /root/.nvm/nvm.sh: command not found
    default: /srv/provision/extensions/core/nvm/provision.sh: line 29: nvm: command not found
    default:  ✔ The 'extension-core-nvm' provisioner completed in 2 seconds.

The provisioner log shows

 ▷ Running the 'extension-core-nvm' provisioner...
 * Checking for NVM
 * NVM v0.37.2 installation starting now
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed

  0     0    0     0    0     0      0      0 --:--:-- --:--:-- --:--:--     0
 57 13527   57  7746    0     0  57377      0 --:--:-- --:--:-- --:--:-- 56955
100 13527  100 13527    0     0  99463      0 --:--:-- --:--:-- --:--:-- 98737
=> Downloading nvm from git to '/root/.nvm'

=> Cloning into '/root/.nvm'...
=> Compressing and cleaning up git repository

=> Appending nvm source string to /root/.bashrc
=> Appending bash_completion source string to /root/.bashrc
=> Close and reopen your terminal to start using nvm or run the following to use it now:

export NVM_DIR="$HOME/.nvm"
[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh"  # This loads nvm
[ -s "$NVM_DIR/bash_completion" ] && \. "$NVM_DIR/bash_completion"  # This loads nvm bash_completion
sudo: /root/.nvm/nvm.sh: command not found
 ✓ NVM installed
/srv/provision/extensions/core/nvm/provision.sh: line 29: nvm: command not found
 * NVM default set to system default
 ✔ The 'extension-core-nvm' provisioner completed in 2 seconds.

How do we reproduce it?

Follow the steps above on a fresh install

VVV Status screen

[mike@Macster: /vm/] $ vagrant status
__ __ __ __
\ V\ V\ V / v3.9.0 Path:"/Volumes/EVO/Active_Sites/NESN/VM/vm"
 \_/\_/\_/  git::develop(b47e6c4)

Platform: darwin19 shell:/usr/local/bin/bash vagrant-goodhosts shared_db_folder_disabled
Vagrant: v2.2.19, virtualbox: v6.0.24

Docs:       https://varyingvagrantvagrants.org/
Contribute: https://github.com/varying-vagrant-vagrants/vvv
Dashboard:  http://vvv.test

Current machine states:

default                   running (virtualbox)

The VM is running. To stop this VM, you can run `vagrant halt` to
shut it down forcefully, or you can run `vagrant suspend` to simply
suspend the virtual machine. In either case, to restart it again,
simply run `vagrant up`.
[mike@Macster: /vm/] $

Which Operating System are you using?

Apple MacOS (Intel)

Which provider are you using?

VirtualBox

tomjn commented 2 years ago

latest commit should correct this

tomjn commented 2 years ago

I'm going to close this as fixed, if this is still an issue feel free to reopen