Skip to content
/ nvshim Public
generated from iamogbz/oss-boilerplate

πŸ„ Automagically use the correct version of node with nvm

License

Notifications You must be signed in to change notification settings

iamogbz/nvshim

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Aug 31, 2023
febfbb4 Β· Aug 31, 2023
Jan 26, 2023
Jan 26, 2023
Jan 26, 2023
Sep 13, 2019
Jul 18, 2023
Aug 31, 2023
Mar 25, 2022
Sep 16, 2019
Sep 8, 2019
Dec 5, 2019
Jan 26, 2023
Jan 26, 2023
Feb 22, 2022
Mar 25, 2022
Jul 6, 2019
Jul 6, 2019
Mar 18, 2020
Sep 13, 2019
Aug 30, 2023
Jun 28, 2023
Sep 9, 2019
Jan 26, 2023
Feb 22, 2022
Feb 22, 2022
Apr 14, 2022
Sep 10, 2019
Aug 31, 2023

Repository files navigation

NVM Shim

LOGO

Automagically use the correct version of node with nvm exec functionality.

Build Status Coverage Status Pypi Stage Wheel Dependabot badge

No more nvm use

This will use existing .nvmrc file, falling back to the nvm alias default version if no config detected.

Installation

Pip

pip install nvshim

Github

pip install git+git://github.com/iamogbz/nvshim.git

Configuration

Reads all configuration from the environment.

Relies on nvm being installed and configured correctly.

NVSHIM_AUTO_INSTALL

Set to 1 or true to auto install specified version of node if not installed by nvm.

NVSHIM_VERBOSE

Set to 1 or true to show more information on the shimmed node process.

Otherwise set to 0 or false or nothing.

Caveats

  1. To allow the nvshim installed node shim work in all directories, you'll need to stop sourcing nvm.sh in your shell rc i.e. bash_profile, zshrc etc.

    • Just comment out the source /Users/me/.nvm/nvm.sh in your shell startup script. This is optional and prevents nvm from taking control of your shell path on launch.
    • With nvm shimmed, nvm use commands do not have any effect on the shell, the node version is already always gotten from the config automatically.
  2. The scope of this project only shims the node, npm, npx and nvm binaries. Any globally installed modules are not automatically shimmed.

    • It is still easy to run a specific global bin e.g. npx eslint will alway run the version of eslint installed via the node version for the current shell.
    • Indicate your interest in having this tool shim all binaries installed via node by leaving a comment here.

Contribution

All forms of contribution welcome, please see guide.

make install
make tests a="--snapshot-update"