Skip to content
This repository has been archived by the owner on Mar 28, 2021. It is now read-only.

Improve output when problems with PATH #3

Closed
shadowspawn opened this issue Dec 1, 2018 · 3 comments
Closed

Improve output when problems with PATH #3

shadowspawn opened this issue Dec 1, 2018 · 3 comments

Comments

@shadowspawn
Copy link
Owner

Feature Request

Improve output when the installed version is not the active version.

Problem

The output from install gives a clue that there is a problem, but is very subtle, and looks like nvh is faulty. For example:

$ NVH_PREFIX=~/nvh nvh install 8

  installing : node/v8.14.0
       mkdir : /Users/john/nvh/nvh/versions/node/v8.14.0
       fetch : https://nodejs.org/dist/v8.14.0/node-v8.14.0-darwin-x64.tar.gz
   installed : v10.14.0

Proposed Solution

  1. change the installed line to refer to version installed by nvh
  2. if installed version not active version, add warning about active location. Suggest run nvh doctor?

Doctor

nvh doctor does already warn about some problems, but only if the user runs it.

$ NVH_PREFIX=~/nvh nvh doctor
...
Checking nvh install destination is in PATH...
possible problem, '/Users/john/nvh/bin' is not in PATH
@shadowspawn
Copy link
Owner Author

Work in progress:

$ NVH_PREFIX=~/oops nvh install 8

  installing : node/v8.14.0
       mkdir : /Users/john/oops/nvh/versions/node/v8.14.0
       fetch : https://nodejs.org/dist/v8.14.0/node-v8.14.0-darwin-x64.tar.gz
   installed : v8.14.0

Installed node to: /Users/john/oops/bin/node
but active node at: /usr/local/bin/node
(try running 'nvh doctor')

@shadowspawn
Copy link
Owner Author

Second try, present extra information in consistent format. Less noisy, so not annoying when it isn't an error condition (like preparing environment, running tests).

$ export NVH_PREFIX=~/DELETEME
$ nvh install lts

  installing : node/v10.14.1
       mkdir : /Users/john/DELETEME/nvh/versions/node/v10.14.1
       fetch : https://nodejs.org/dist/v10.14.1/node-v10.14.1-darwin-x64.tar.gz
   installed : v10.14.1 to /Users/john/DELETEME/bin/node
      active : v8.14.0 at /usr/local/bin/node

$ nvh install lts
   installed : v10.14.1 to /Users/john/DELETEME/bin/node
      active : v8.14.0 at /usr/local/bin/node
$ export PATH=${NVH_PREFIX}/bin:$PATH
$ nvh install lts
   installed : v10.14.1

@shadowspawn
Copy link
Owner Author

Resolved in v6.1.0

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

1 participant