Skip to content

Instantly share code, notes, and snippets.

@xyberviri
Last active April 30, 2024 17:50
Show Gist options
  • Save xyberviri/7ab7cf8d34e93d98a662be3ad919699f to your computer and use it in GitHub Desktop.
Save xyberviri/7ab7cf8d34e93d98a662be3ad919699f to your computer and use it in GitHub Desktop.
node.js portable
For windows download the latest `node-X.X.X-win-x64.7z` from the nodejs site https://nodejs.org/dist/latest/
go to the folder and run `nodevars.bat`
next run `npm install npm@latest`
and your done...
you now have a updated nodejs until you logout, then you just go back and run `nodevars.bat` the next time you need it.
@xyberviri
Copy link
Author

I have been informed that this will put a node_modules folder in your user profile location, to put these modules on a thumb / other folder do the following:

Set the thumb drive letter to something that will NOT change between systems like P otherwise stuff breaks

extract the zip files to that drive in the location you want node.js like before im going to assume P:\node-v22.0.0-win-x64\

edit the 4th line of nodevars.bat from set "PATH=%APPDATA%\npm;%~dp0;%PATH%" to set "PATH=%~dp0;%PATH%"

then open a new command prompt and type cd /d P:\node-v22.0.0-win-x64\

then npm install npm@latest that should throw everything into P:\node-v22.0.0-win-x64\ i have zero clue what the repercussions of doing this are but stuff seems to work.

when you open a command prompt and type P:\node-v22.0.0-win-x64\nodevars.bat it should add P:\node-v22.0.0-win-x64\ to your systems %PATH% for that command prompt session.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment