Nvm(nvm-sh/nvm)

nvm-sh/nvm 是一个 POSIX-compliant bash script,用来管理多套 active node.js versions,适合需要在本地频繁切换环境的前端开发。它通过脚本直接接管终端,省去了手动配置路径的麻烦。

96.1k · Shell

只要在项目根目录丢一个包含版本号的文本文件,就能在进入目录时自动匹配对应的运行时。代价是必须把这套 bash script 塞进终端初始化流程里,换取的是再也不用每次手动敲命令切换环境。

README 摘录

<a href="https://github.com/nvm-sh/logos"> <picture> <source media="(prefers-color-scheme: dark)" srcset="https://raw.githubusercontent.com/nvm-sh/logos/HEAD/nvm-logo-white.svg" /> <img src="https://raw.githubusercontent.com/nvm-sh/logos/HEAD/nvm-logo-color.svg" height="50" alt="nvm project logo" /> </picture> </a> # Node Version Manager [![Tests](https://github.com/nvm-sh/nvm/actions/workflows/tests-fast.yml/badge.svg?branch=master)][3] [![nvm version](https://img.shields.io/badge/version-v0.41.0-yellow.svg)][4] [![CII Best Practices](https://bestpractices.dev/projects/684/badge)](https://bestpractices.dev/projects/684) <!-- To update this table of contents, ensure you have run `npm install` then `npm run doctoc` --> <!-- START doctoc generated TOC please keep comment here to allow auto update --> <!-- DON'T EDIT THIS SECTION, INSTEAD RE-RUN doctoc TO UPDATE --> ## Table of Contents - [Intro](#intro) - [About](#about) - [Installing and Updating](#installing-and-updating) - [Install & Update Script](#install--update-script) - [Additional Notes](#additional-notes) - [Installing in Docker](#installing-in-docker) - [Installing in Docker for CICD-Jobs](#installing-in-docker-for-cicd-jobs) - [Troubleshooting on Linux](#troubleshooting-on-linux) - [Troubleshooting on macOS](#troubleshooting-on-macos) - [Ansible](#ansible) - [Verify Installation](#verify-installation) - [Important Notes](#important-notes) - [Git Install](#git-install) - [Manual Install](#manual-install) - [Manual Up

GitHub