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

Shim all npm installable binaries #137

Open
iamogbz opened this issue Mar 31, 2021 · 0 comments
Open

Shim all npm installable binaries #137

iamogbz opened this issue Mar 31, 2021 · 0 comments
Labels
enhancement New feature or request

Comments

@iamogbz
Copy link
Owner

iamogbz commented Mar 31, 2021

Is your feature request related to a problem? Please describe.

While this shims node, npm and npx to use the current project/global version. The binaries installed after an npm install are not shimmed. The correct bins are still accessible via npx, but that's not as intuitive as just running eslint directly.

Describe the solution you'd like

  • npm install eslint installs eslint using the current project version npm
  • which eslint points to the eslint in the correct npm bin path
  • Launch a new shell
  • which eslint should still be shimmed to the correct bin based on current project version

Describe alternatives you've considered

  1. Shim all binaries post npm installation.
    After the shimmed node binaries run, check the current version npm bin -g and add a shim for any new npm installed binaries that would handle redirecting to the correct version based on the current project.

    • Maybe include an environment variable NVSHIM_AUTO_INSTALL_SHIM=1 that controls if globally installed bins should have specific shims created
    • When a global shim does not exist for the current version of node what is the behaviour? Print warning and instructions?
      Attempting to call global `eslint` but it is not installed for `node` v16.2.1.
      Run `npm -g install eslint` to install for your current version.
      Or switch your `nvm` config to a version that has it installed.
      Available local node versions are `18.9.0`, `16.2.1`, `14.7.1`.
  2. Configure the PATH to include npm binaries.
    After nvshim is installed, configure the shell to set up dynamic environment PATH. Although at this point how is it different from the other solutions that modify the shell on directory change.

  3. Do nothing.
    npx is sufficient, just document that this is not within the scope of the project.

Additional context

@iamogbz iamogbz added the enhancement New feature or request label Jun 28, 2023
iamogbz added a commit that referenced this issue Jun 28, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant