0

In bash, I can use this command to update my current node version of nvm to the latest minor version:

nvm install $(nvm current | sed -rn "s/v([[:digit:]]+).*/\1/p") --reinstall-packages-from=$(nvm current)

How to do the same in Batch using nvm-windows?

source

Martin Braun
  • 10,906
  • 9
  • 64
  • 105

1 Answers1

0

You can achieve the same from the window using a batch file.

Create a batch file with the following text:

@echo off 
FOR /F "tokens=* USEBACKQ" %%F IN (`nvm current`) DO (
SET var=%%F
)
SET var=%var:v=%
SET unused=%var:*.=%
CALL SET var=%%var:%unused%=%%
SET var=%var:.=%
nvm install %var%

Then run your batch file from "cmd"

I tried with the same in my system.

Ashok Dhaduk
  • 165
  • 2
  • 8