DEV Community

Discussion on: Portable NodeJS without administrator access

Collapse
 
khakimvinh profile image
khakimvinh

Thanks William.

I would like to point out a few things:

  1. It's not really portable since if you move to a new machine, you may need to setup the environment variables again.
  2. Anyone stuck or hit errors on step 5, may want to modify the install.md, original one seem buggy and only for administrator.

I modified mine as blow if anyone interested:

@echo off
set /P NVM_PATH="Enter the absolute path where the zip file is extracted/copied to: "
setx NVM_HOME "%NVM_PATH%"
set NVM_SYMLINK=C:\Program Files\nodejs
setx NVM_SYMLINK "%NVM_SYMLINK%"
setx PATH "%PATH%;%NVM_PATH%;%NVM_SYMLINK%"

if exist "%SYSTEMDRIVE%\Program Files (x86)\" (
set SYS_ARCH=64
) else (
set SYS_ARCH=32
)
(echo root: %NVM_PATH% && echo path: %NVM_SYMLINK% && echo arch: %SYS_ARCH% && echo proxy: none) > %NVM_PATH%\settings.txt
@echo on

Collapse
 
dainiuxt profile image
Dainius

Lifesaver!