(This is a corrected version of this blog post)
- Install Cmder in your desired location.
- Download
nvm-noinstall.zipfrom the latest release. - Extract the contents of
nvm-noinstall.zip(i.e.:nvm.exe…) into thebinfolder inside of the portable Cmder folder. - Navigate to the
bin. - Create a new file called
install_fix.cmdthat contains this code. - Open a terminal in the
binfolder and type.\install_fix.cmd - When asked to enter the path use the full path to your Cmder
binfolder. - If it worked, a file called
settings.txthas been created in the your Cmderbinfolder. - Close the terminal, and reopen it in the
binfolder. - Install the version of Node you want, e.g.
nvm install latest. - Wait until the installation is completed, then, inside the
binfolder, there should be a new folder containing the latest Node version (e.g.v17.3.0).
From there, you can use the full path to your Cmder bin + the Node version folder + node.exe to execute something with this version of Node using Powershell, CMD or other terminal.
For example:
PS D:\experiments\my-stuff\> D:\experiments\nodejs-portable\cmder_mini\bin\v17.3.0\node.exe index.js
You could use Cmder with the Node path in the Startup Settings of the app; e.g. set "PATH=D:\experiments\nodejs-portable\cmder_mini\bin\v17.3.0;%PATH%". This way, in Cmder, when typing node.exe it’s the portable version that will be used.