<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: ethanwhall389</title>
    <description>The latest articles on DEV Community by ethanwhall389 (@ethan-wes-hall).</description>
    <link>https://dev.to/ethan-wes-hall</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F1115331%2Face2b638-43b2-4a1a-ba9e-965cd365f1ae.jpeg</url>
      <title>DEV Community: ethanwhall389</title>
      <link>https://dev.to/ethan-wes-hall</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/ethan-wes-hall"/>
    <language>en</language>
    <item>
      <title>Portable Dev Environment: VScode, Nodejs, npm</title>
      <dc:creator>ethanwhall389</dc:creator>
      <pubDate>Tue, 25 Feb 2025 16:12:10 +0000</pubDate>
      <link>https://dev.to/ethan-wes-hall/portable-dev-environment-vscode-nodejs-npm-k57</link>
      <guid>https://dev.to/ethan-wes-hall/portable-dev-environment-vscode-nodejs-npm-k57</guid>
      <description>&lt;p&gt;I recently wanted to figure out a way to place an entire development environment on a flash drive or portable SSD that I could take with me anywhere, plug into a PC, and to development work straight from there. &lt;/p&gt;

&lt;p&gt;This proved significantly harder to do than I had first expected, with very little documentation online about how to achieve this. After spending quite a few hours trying different methods and techniques, I think I've found the best solution.&lt;/p&gt;

&lt;p&gt;We are going to be placing a portable version of VS Code, Nodejs (with npm) and git on a single flash drive that can be used in any windows computer. We're also going to be using a portable terminal program (Cmder). Let's get started.&lt;/p&gt;

&lt;h2&gt;
  
  
  Step 1. Downloads
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;VS Code 

&lt;ul&gt;
&lt;li&gt;Go to the &lt;a href="https://code.visualstudio.com/download" rel="noopener noreferrer"&gt;VS Code download page&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;Download the .zip x64 for windows.&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;

&lt;li&gt;Nodejs 

&lt;ul&gt;
&lt;li&gt;Go to the &lt;a href="https://nodejs.org/en/download" rel="noopener noreferrer"&gt;Nodejs download page&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;Download the Standalone Binary (.zip)&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;

&lt;li&gt;Git

&lt;ul&gt;
&lt;li&gt;Go to the &lt;a href="https://git-scm.com/downloads/win" rel="noopener noreferrer"&gt;Git download page&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;Download the 64-bit "Portable Thumbdrive Edition"&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;

&lt;li&gt;Cmder

&lt;ul&gt;
&lt;li&gt;Go to the &lt;a href="https://cmder.app/" rel="noopener noreferrer"&gt;Cmder download page&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;Download the Mini version (the full version already includes Git, but we're installing it separately).&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;

&lt;/ul&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F08t2afzso4hg3a0wp61m.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F08t2afzso4hg3a0wp61m.png" alt="Image description" width="557" height="227"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Extract each of these downloads here to the downloads page (but not the Git download yet).&lt;/p&gt;

&lt;h2&gt;
  
  
  Step 2. Folder Structure
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;Mount your flashdrive or SSD in your PC, and open it. &lt;em&gt;Mine opens as drive D, yours may be different. Adjust paths below accordingly.&lt;/em&gt;
&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Create the following structure:&lt;br&gt;
D:&lt;br&gt;
|-cmder&lt;br&gt;
|-git&lt;br&gt;
|-nodejs&lt;br&gt;
|-vscode&lt;br&gt;
|-Projects&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Copy the files from the extracted cmder-mini folder into your D:/cmder folder.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Copy the files from the extracted node folder into your D:/nodejs folder&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Copy the files from the extracted VSCode into your D:/vscode folder&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Run the PortableGit "installer". Place D:\git in the extraction field. This will basically just extract the git files there.&lt;br&gt;
&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F771kcntsqgfubciriu2y.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F771kcntsqgfubciriu2y.png" alt="Image description" width="474" height="219"&gt;&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Step 3. Make VS Code Portable
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;To set the vscode mode to portable, go to D:/vscode. &lt;/li&gt;
&lt;li&gt;Create an empty folder and call it "data". Now, open the Code.exe application that is also in the /vscode folder. This will create some required files automatically. You can close it after it has opened.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Step 4. Set up Cmder
&lt;/h2&gt;

&lt;p&gt;At this point everything is basically set up! The only issue is that if we try to use node or git in a terminal, we're likely going to get an error that these commands are not recognized. That is why I've chosen to also download Cmder because it makes it easy to set up node and git, and it's so much nicer than the default windows command prompt. &lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Navigate to D:/cmder and run Cmder.exe for the first time to create some necessary files. Close after opening.&lt;/li&gt;
&lt;li&gt;Navigate to D:/cmder/config and right click -&amp;gt; &lt;em&gt;edit the user_profile.cmd&lt;/em&gt; file.

&lt;ul&gt;
&lt;li&gt;Here, we need to tell Cmder to set the proper paths to node and git when it opens so that we can use them. It already has some boilerplate code here. At the end of the file, before

&lt;code&gt;@echo off&lt;/code&gt;

Add the following:
&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;

&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;set PATH=D:\nodejs;D:\git\cmd;%PATH%
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This sets the two paths, one to our nodejs folder, and the other to our git/cmd folder where are git executable it located.&lt;br&gt;
&lt;em&gt;Note that you may need to edit these paths if you've set up your structure differently / use a different drive letter.&lt;/em&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Save and close the .cmd file.&lt;/li&gt;
&lt;li&gt;Now, re-open Cmder (D:/cmder/Cmder.exe). It should automatically set the path upon opening. To test it, run:
&lt;/li&gt;
&lt;/ul&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;node -v
npm -v
git --version
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;


&lt;p&gt;This should return something like 11.1.0 under each command. If it does, congrats! You've successfully gotten node, npm, and git working on a portable drive.&lt;/p&gt;
&lt;h2&gt;
  
  
  Step 5. Usage
&lt;/h2&gt;

&lt;p&gt;To use this setup: &lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Navigate to your D:/vscode folder and open the vscode.exe executable. &lt;/li&gt;
&lt;li&gt;Open your cmder terminal either through the cmder.exe, or through the vscode terminal command shown in the optional step below.&lt;/li&gt;
&lt;li&gt;In the terminal, navigate to D:/Projects. &lt;/li&gt;
&lt;li&gt;Use your normal git clone commands to bring in a repository, use npm install your dependencies, etc. You should have access to all your normal git and node commands.
&lt;em&gt;NOTE: If using a flash drive, not that it might take a long while to install dependencies and large files.&lt;/em&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;h2&gt;
  
  
  OPTIONAL step 5. Make Cmder the default vscode terminal
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;in vscode, use ctrl+shift+p and type: "open user settings". Select the "Open User Settings (JSON)" option.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Here, inside the object syntax, paste:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;//This first section sets the default terminal to Cmder
"terminal.integrated.defaultProfile.windows": "Cmder",
"terminal.integrated.profiles.windows": {
    "Cmder": {
        "path": "D:\\cmder\\Cmder.exe" //...or whichever path you use
    }
},
//This second section sets where the terminal's root will be. We want it to be in the root of the drive.
"terminal.integrated.cwd": "D:\\",
"git.path": "D:\\git\\bin\\git.exe"
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;em&gt;NOTE: The file paths above must use the double slash syntax.&lt;/em&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Conclusion
&lt;/h2&gt;

&lt;p&gt;Hopefully this was helpful to you and will save you some of the pain I had trying to figure out a workable solution. Cheers!&lt;/p&gt;

</description>
      <category>webdev</category>
      <category>node</category>
      <category>vscode</category>
      <category>portable</category>
    </item>
  </channel>
</rss>
