Easily create portable version of VS Code with Angular CLI and Node.js

Rafay Jamal
3 min readJun 27, 2018

A portable version of VS code comes handy when you don’t have installation rights for a software or when you are on someone else’s machine and do not want to stop coding.

Few days back, my machine broke down and I wanted to use VS Code for my angular project development. I got a friends machine but didn’t have installation right. Argghhh!

So, I decided to have portable version which I can have in my flash drive and use it where ever I want.

If you want to download then you can download it from this link, but if you are someone like me who want to do it on there own then follow on.

This will be the folder structure of our code

PortabelApp
| — node-v10.4.0-win-x64
| ` — nodevars.bat
| ` — npm.cmd
| ` — npx.cmd
| — VSCode-win32-x64–1.24.0
| ` — Code.exe
| ` — setnode.bat

  1. Create a folder name PortabelApp
  2. Download and Extract VS Code and Node.js in this folder as mention below
  3. VS Code, download a zip version from the Microsoft website. I have downloaded this version. VSCode-win32-x64–1.24.0.zip

4. Node.js, download a zip version from the download page. I downloaded the following version node-v10.4.0-win-x64.zip

5. Extract both the file and move them to the PortableApp folder

6. Go ahead and launch the VS Code.

7. Let’s do some user setting in VS Code to set portable node environment to our editor.

In the above setting, we are adding CMD as our default shell in line 2. In line 3 current working directory is set to where our code.exe is present and line 4 is running a node batch file when the terminal is launched.

8. Now open the terminal and it will be set to the Node.js environment for you. If everything went well then you will get this message

Your environment has been set up for using Node.js 10.4.0 (x64) and npm.

9. Now run these command to install the typescript and @angular/cli. I am still not ready for angular 6 so I like to download the specific version of cli.

`npm i –g typescript @angular/cli@1.7.4`

10. On success, you will get the ng and tsc in node folder. This will be the folder structure

PortabelApp
| — node-v10.4.0-win-x64
| ` — nodevars.bat
| ` — npm.cmd
| ` — npx.cmd
| ` — ng.cmd
| ` — tsc.cmd
| — VSCode-win32-x64–1.24.0
| ` — Code.exe
| ` — setnode.bat

Now you just need to open the folder where your project is and navigate to the folder using the command line and you are good to go.

If you like it then share it with like minded. {•̃_•̃}

--

--