A lightweight Node.js version manager for Windows, written in PowerShell. Ideal for restricted environments without administrative privileges.
Um gerenciador leve de versões do Node.js para Windows, escrito em PowerShell. Ideal para ambientes restritos sem privilégios administrativos.
Node Version Switch (NVS) simplifies managing multiple Node.js versions on Windows in restricted environments where users lack administrative access. Switching between legacy and current Node.js versions is seamless with NVS, designed for developers needing agility.
Unlike tools like NVM, which may require WSL setup, NVS offers:
- No system installation: Stores Node.js binaries in a user-controlled directory.
- Lightweight: Modifies only the user’s PATH, preserving system integrity.
- Flexible: Supports partial versions (e.g.,
nvs install 20installs the latest LTS) and x86/x64 architectures. - Open-source: MIT License, welcoming community contributions.
Explore the project at nodenvs.vercel.app!
No Node.js version should be in the system PATH (e.g., C:\Program Files\nodejs). Global Node.js installations may conflict with NVS. Remove any Node.js entries from the system PATH before using NVS. In corporate environments, this may require IT support.
- Install, activate, uninstall, and list Node.js versions.
- Support for x86 and x64 architectures.
- Simple setup with an
nvsalias in the PowerShell profile. - Partial version support (e.g.,
nvs install 20installs the latest LTS). - List available versions with LTS filtering and descending order.
- Windows 10 or 11.
- PowerShell 5.1 or PowerShell Core 7+.
- Write permissions in the project directory.
- Internet connection for downloading Node.js versions.
nodeversionswitch/
├── nvs/nvs.ps1 # Main script
├── nodejs-versions/ # Node.js version binaries
├── nodejs-configs/ # Configuration files
├── README.md # Documentation
├── LICENSE.txt # MIT License
├── .gitignore # Git ignore file
├── CONTRIBUTING.md # Contribution guidelines
Note: If you downloaded the script (e.g., as a ZIP from GitHub) or are using a system with restricted PowerShell policies, you must unblock the script and set the execution policy before running it.
-
Download or Clone:
- Clone the repository or download the ZIP from GitHub.
- Place it in a directory with write permissions (e.g.,
D:\Projects\nodeversionswitch):git clone https://github.com/eduardozaniboni/nodeversionswitch.git D:\Projects\nodeversionswitch
-
Unblock Files:
- For downloaded files, unblock the script to avoid the "not digitally signed" error:
Unblock-File -Path D:\Projects\nodeversionswitch\nvs\nvs.ps1
- For downloaded files, unblock the script to avoid the "not digitally signed" error:
-
Set Execution Policy:
- Allow local scripts by setting the PowerShell execution policy:
Set-ExecutionPolicy -Scope CurrentUser -ExecutionPolicy RemoteSigned -Force
- Allow local scripts by setting the PowerShell execution policy:
-
Run Setup:
- Navigate to the project directory:
cd D:\Projects\nodeversionswitch\nvs
- Execute the setup to create folders and configure the
nvsalias:.\nvs.ps1 setup
- Navigate to the project directory:
-
Load the Alias:
- Apply the alias in the current session:
. $PROFILE
- Or open a new PowerShell terminal.
- Apply the alias in the current session:
Note: Commands and help are in English, but full Portuguese instructions are below.
Run nvs help to see all commands. Below are the available commands with examples:
| Command | Description | Example |
|---|---|---|
nvs setup |
Sets up folders (nodejs-versions/, nodejs-configs/) and the nvs alias. |
nvs setup |
nvs list |
Lists installed Node.js versions. | nvs list |
nvs available [-LTS] [filter] |
Lists available Node.js versions, optionally filtered by LTS or version prefix. | nvs available -LTSnvs available 20 |
nvs install [x86|x64] |
Installs a Node.js version (full or partial, e.g., 20 for latest LTS; default: x64). |
nvs install 20 x86nvs install 20.17.0 |
nvs use |
Activates a specific Node.js version in the user PATH. | nvs use 20.17.0 |
nvs uninstall |
Removes a specific Node.js version. | nvs uninstall 20.17.0 |
nvs current |
Shows the currently active Node.js version. | nvs current |
nvs reset |
Removes all folders and the nvs alias. |
nvs reset |
nvs help |
Displays the command list and examples. | nvs help |
# List available LTS versions
nvs available -LTS
# Install the latest LTS version of Node.js 20.x.x (x86)
nvs install 20 x86
# Activate Node.js 20.17.0
nvs use 20.17.0
# Check the active version
nvs current
# List installed versions
nvs list
# Uninstall Node.js 20.17.0
nvs uninstall 20.17.0
# Reset all configurations
nvs reset- "Not digitally signed" error:
- Ensure you ran
Unblock-Filebefore executing the script:Unblock-File -Path D:\Projects\nodeversionswitch\nvs\nvs.ps1
- Set the execution policy to allow local scripts:
Set-ExecutionPolicy -Scope CurrentUser -ExecutionPolicy RemoteSigned -Force
- The script unblocks itself during
setup, but initial runs require manual unblocking if downloaded from the internet. - In corporate environments, contact IT if policies are locked (e.g.,
AllSignedorRestricted).
- Ensure you ran
- Permission error:
- Move the project to a directory with write permissions (e.g.,
D:\Projects). - Verify write access:
New-Item -Path D:\Projects\nodeversionswitch\test.txt -ItemType File
- Move the project to a directory with write permissions (e.g.,
- Network failure:
- Check internet connectivity or proxy settings for
nvs installornvs available.
- Check internet connectivity or proxy settings for
- Conflicts with other Node.js installations:
- Remove Node.js from the system PATH (e.g.,
C:\Program Files\nodejs). Contact IT if restricted.
- Remove Node.js from the system PATH (e.g.,
- Alias not working:
- Run
. $PROFILEor open a new terminal. - Check the alias in
notepad $PROFILE.
- Run
- No LTS version found:
- If
nvs install 20fails, usenvs available 20to list all versions.
- If
Contributions are welcome! To contribute:
- Fork the repository.
- Create a feature branch (
git checkout -b feature/new-feature). - Commit changes (
git commit -m 'Add new feature'). - Push to your fork (
git push origin feature/new-feature). - Open a Pull Request.
See CONTRIBUTING.md for details. Report issues at GitHub Issues. Portuguese contributions are also welcome!
⭐ Support the project by starring it on GitHub!
Visit the official Node Version Switch website for a user-friendly guide and documentation: nodenvs.vercel.app.
- GitHub: eduardozaniboni
- LinkedIn: eduardozaniboni
Feedback and suggestions are appreciated!
Licensed under the MIT License. See LICENSE.txt for details.
O Node Version Switch (NVS) simplifica o gerenciamento de versões do Node.js em máquinas Windows com restrições administrativas, onde usuários não têm privilégios de administrador. Alternar entre versões legadas e atuais do Node.js é fácil com o NVS, projetado para desenvolvedores que precisam de agilidade.
Diferente de ferramentas como NVM, que podem exigir WSL, o NVS oferece:
- Sem instalação no sistema: Armazena binários do Node.js em um diretório controlado pelo usuário.
- Leveza: Modifica apenas o PATH do usuário, sem alterar o sistema.
- Flexibilidade: Suporta versões parciais (ex.:
nvs install 20instala a LTS mais recente) e arquiteturas x86/x64. - Open-source: Licença MIT, aberto a contribuições da comunidade.
Explore o projeto em nodenvs.vercel.app!
Nenhuma versão do Node.js deve estar no PATH do sistema (ex.: C:\Program Files\nodejs). Instalações globais do Node.js podem conflitar com o NVS. Remova entradas do Node.js do PATH do sistema antes de usar o NVS. Em ambientes corporativos, isso pode exigir suporte de TI.
- Instala, ativa, desinstala e lista versões do Node.js.
- Suporte a arquiteturas x86 e x64.
- Configuração simples com alias
nvsno perfil do PowerShell. - Suporte a versões parciais (ex.:
nvs install 20instala a LTS mais recente). - Lista versões disponíveis com filtro LTS e ordenação decrescente.
- Windows 10 ou 11.
- PowerShell 5.1 ou PowerShell Core 7+.
- Permissões de escrita no diretório do projeto.
- Conexão com a internet para baixar versões do Node.js.
nodeversionswitch/
├── nvs/nvs.ps1 # Script principal
├── nodejs-versions/ # Binários das versões do Node.js
├── nodejs-configs/ # Arquivos de configuração
├── README.md # Documentação
├── LICENSE.txt # Licença MIT
├── .gitignore # Arquivo de exclusão do Git
├── CONTRIBUTING.md # Diretrizes de contribuição
Nota: Se você baixou o script (ex.: como ZIP do GitHub) ou está usando um sistema com políticas restritivas do PowerShell, é necessário desbloquear o script e definir a política de execução antes de executá-lo.
-
Baixar ou Clonar:
- Clone o repositório ou baixe o ZIP de GitHub.
- Coloque em um diretório com permissões de escrita (ex.:
D:\Projects\nodeversionswitch):git clone https://github.com/eduardozaniboni/nodeversionswitch.git D:\Projects\nodeversionswitch
-
Desbloquear Arquivos:
- Para arquivos baixados, desbloqueie o script para evitar o erro "not digitally signed":
Unblock-File -Path D:\Projects\nodeversionswitch\nvs\nvs.ps1
- Para arquivos baixados, desbloqueie o script para evitar o erro "not digitally signed":
-
Definir Política de Execução:
- Permita scripts locais definindo a política de execução do PowerShell:
Set-ExecutionPolicy -Scope CurrentUser -ExecutionPolicy RemoteSigned -Force
- Permita scripts locais definindo a política de execução do PowerShell:
-
Executar Configuração:
- Navegue até o diretório do projeto:
cd D:\Projects\nodeversionswitch\nvs
- Execute a configuração para criar pastas e configurar o alias
nvs:.\nvs.ps1 setup
- Navegue até o diretório do projeto:
-
Carregar o Alias:
- Aplique o alias na sessão atual:
. $PROFILE
- Ou abra um novo terminal PowerShell.
- Aplique o alias na sessão atual:
Nota: Os comandos e a ajuda estão em inglês, mas instruções completas em português estão abaixo.
Execute nvs help para ver todos os comandos. Abaixo estão os comandos disponíveis com exemplos:
| Comando | Descrição | Exemplo |
|---|---|---|
nvs setup |
Configura pastas (nodejs-versions/, nodejs-configs/) e o alias nvs. |
nvs setup |
nvs list |
Lista versões do Node.js instaladas. | nvs list |
nvs available [-LTS] [filtro] |
Lista versões disponíveis do Node.js, com filtro opcional por LTS ou prefixo. | nvs available -LTSnvs available 20 |
nvs install [x86|x64] |
Instala uma versão do Node.js (completa ou parcial, ex.: 20 para LTS mais recente; padrão: x64). |
nvs install 20 x86nvs install 20.17.0 |
nvs use |
Ativa uma versão específica do Node.js no PATH do usuário. | nvs use 20.17.0 |
nvs uninstall |
Remove uma versão específica do Node.js. | nvs uninstall 20.17.0 |
nvs current |
Mostra a versão ativa do Node.js. | nvs current |
nvs reset |
Remove todas as pastas e o alias nvs. |
nvs reset |
nvs help |
Exibe a lista de comandos e exemplos. | nvs help |
# Listar versões LTS disponíveis
nvs available -LTS
# Instalar a versão LTS mais recente da série 20.x.x (x86)
nvs install 20 x86
# Ativar a versão 20.17.0
nvs use 20.17.0
# Verificar a versão ativa
nvs current
# Listar versões instaladas
nvs list
# Desinstalar a versão 20.17.0
nvs uninstall 20.17.0
# Resetar todas as configurações
nvs reset- Erro "not digitally signed":
- Certifique-se de executar
Unblock-Fileantes de rodar o script:Unblock-File -Path D:\Projects\nodeversionswitch\nvs\nvs.ps1
- Defina a política de execução para permitir scripts locais:
Set-ExecutionPolicy -Scope CurrentUser -ExecutionPolicy RemoteSigned -Force
- O script desbloqueia a si mesmo durante o
setup, mas execuções iniciais exigem desbloqueio manual se baixado da internet. - Em ambientes corporativos, contate a TI se as políticas estiverem bloqueadas (ex.:
AllSignedouRestricted).
- Certifique-se de executar
- Erro de permissão:
- Mova o projeto para um diretório com permissões de escrita (ex.:
D:\Projects). - Verifique o acesso:
New-Item -Path D:\Projects\nodeversionswitch\test.txt -ItemType File
- Mova o projeto para um diretório com permissões de escrita (ex.:
- Falha de rede:
- Verifique a conexão com a internet ou configurações de proxy para
nvs installounvs available.
- Verifique a conexão com a internet ou configurações de proxy para
- Conflitos com outras instalações do Node.js:
- Remova o Node.js do PATH do sistema (ex.:
C:\Program Files\nodejs). Contate a TI se restrito.
- Remova o Node.js do PATH do sistema (ex.:
- Alias não funciona:
- Execute
. $PROFILEou abra um novo terminal. - Verifique o alias em
notepad $PROFILE.
- Execute
- Nenhuma versão LTS encontrada:
- Se
nvs install 20falhar, usenvs available 20para listar todas as versões.
- Se
Contribuições são bem-vindas! Para contribuir:
- Faça um fork do repositório.
- Crie uma branch para sua funcionalidade (
git checkout -b feature/nova-funcionalidade). - Faça commit das alterações (
git commit -m 'Adiciona nova funcionalidade'). - Envie para seu fork (
git push origin feature/nova-funcionalidade). - Abra um Pull Request.
Veja o CONTRIBUTING.md para detalhes. Reporte problemas em GitHub Issues. Contribuições em inglês também são bem-vindas!
⭐ Apoie o projeto dando uma estrela no GitHub!
Visite o site oficial do Node Version Switch para um guia amigável e documentação: nodenvs.vercel.app.
- GitHub: Eduardo Zaniboni
- LinkedIn: Eduardo Zaniboni
Feedback e sugestões são sempre bem-vindos!
Licenciado sob a MIT License. Veja o arquivo LICENSE.txt para detalhes.