Skip to content

Instantly share code, notes, and snippets.

@vutran
Last active February 25, 2020 20:36
Show Gist options
  • Save vutran/c7ca1ba693b830fc66b5 to your computer and use it in GitHub Desktop.
Save vutran/c7ca1ba693b830fc66b5 to your computer and use it in GitHub Desktop.
node, npm, git, cmder, and other nifty portable apps (for Windows)

This is a completely portable setup for node, npm, git, and a nice console emulator for Windows.

Downloads

  1. download node (binary) - https://nodejs.org/en/download/
  2. copy to %USERPROFILE%/Application/node/
  3. download npm - https://github.com/npm/npm/releases
  4. unzip to %USERPROFILE%/Application/node/node_modules/npm/
  5. copy npm and npm.cmd from %USERPROFILE%/Application/node/node_modules/npm/bin/ to %USERPROFILE%/Application/node/
  6. download git - https://github.com/git-for-windows/git/releases
  7. unzip to %USERPROFILE%/Application/git/
  8. download cmder mini - http://cmder.net/
  9. unzip to %USERPROFILE%/Application/cmder/
  10. downlod atom editor - https://github.com/atom/atom/releases (atom-windows.zip)
  11. unzip to %USERPROFILE%/Application/Atom/

Configurations

  1. create a new startup tasks in cmder for git sh - https://www.awmoore.com/2015/01/14/setting-up-git-and-cmder/

Task name: git bash

Task parameters: /icon "%USERPROFILE%/Application/git/etc/git.ico"

Task contents: "%USERPROFILE%/Application/git/bin/sh.exe" --login -i" -new_console:d:%USERPROFILE%

  1. Add paths to portable binaries to cmder environment.
# set app path
set APP_PATH=%USERPROFILE%/Applications
 
# set apm bin
set PATH=%APP_PATH%/Atom/resources/app/apm/bin;%PATH%
 
# set node path
set PATH=%APP_PATH%/node;%PATH%
 
# add local node path
set PATH=./node_modules/.bin;%PATH%

Portable Atom (Optional)

NOTE: There's bugs in the portable version so not stable yet such as file/folder permissions.

Create a cmd to launch portable Atom %USERPROFILE/Application/Atom/atom-portable.cmd by specifying ATOM_HOME. (atom/atom#10072)

@echo off
set ATOM_HOME=%~dp0/.atom
start atom.exe %*

Add a taskbar shortcut (Optional): Right-click and drag the atom.exe to the taskbar. Then right-click the new shortcut > Properties and change the target location to atom-portable.cmd. You can change the icon by right-clicking the new shortcut > Properties > Change Icon > (select Atom.exe as the icon)

  1. Install apps from README.md
  2. Install babun
  3. Adds the lines below to .zshrc
export APP_PATH=$HOMEPATH/Applications
export PATH=$APP_PATH/Atom/resources/app/apm/bin:$PATH
export PATH=$APP_PATH/node:$PATH
export PATH=./node_modules/.bin:$PATH
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment