Recovering from a Serious PC Crash
Tags: programming, node, linux
Published: 2023-10-14 21:26:32

---
title: Recovering from a Serious PC Crash
published: true
date: 2023-10-14 00:00:00 UTC
tags: ["programming","node","linux"]
canonical_url: https://logarithmicspirals.com/recovering-from-pc-crash
---

[![A destroyed monitor on the sidewalk with a crushed soda can](https://logarithmicspirals.com/static/85b0583fe29b6daca1dd540b33abefce/828fb/julia-joppien-XFUqd0u5U7w-unsplash.jpg)](/static/85b0583fe29b6daca1dd540b33abefce/0f98f/julia-joppien-XFUqd0u5U7w-unsplash.jpg)

## Introduction[<svg aria-hidden="true" focusable="false" height="16" version="1.1" viewbox="0 0 16 16" width="16"><path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path></svg>](#introduction)

Recently, I suffered a catastrophic failure of my home computer. Running Windows 11 post an upgrade from Windows 10, I suspect the root of the issue was an inadvertent shutdown during the upgrade. This eventually led me to face the dreaded error: [0xc0000001](https://www.google.com/search?q=0xc0000001&oq=0xc0000001&gs_lcrp=EgZjaHJvbWUyBggAEEUYOTIHCAEQABiiBDIHCAIQABiiBDIHCAMQABiiBDIHCAQQABiiBDIHCAUQABiiBNIBCDQ0ODZqMGo3qAIAsAIA&sourceid=chrome&ie=UTF-8). Research suggests that this error might have stemmed from file corruption due to the premature shutdown.

While I'd love to detail the diagnosis process, this article's focus lies elsewhere. My system recovery attempts were unsuccessful, prompting me to get a new SSD and perform a fresh installation. The silver lining? Realizing the significance of early backup processes. Fortunately, my foresight minimized data loss.

With a brand new Windows 11, I embarked on the journey of reconstructing my local development environment.

## Recreating My Development Environment[<svg aria-hidden="true" focusable="false" height="16" version="1.1" viewbox="0 0 16 16" width="16"><path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path></svg>](#recreating-my-development-environment)

In my initial setup phase, I adhered to my tried-and-true method: creating an admin and a standard user account. This approach, honed over years of Windows usage, acts as a safety net, preventing inadvertent errors that require elevated permissions.

I'll fast forward a bit. After setting up my standard environment, I ventured into reconstructing my Node development environment. Historically, I've relied on [nvm-windows](https://github.com/coreybutler/nvm-windows). For the uninitiated, `nvm-windows`, akin to [nvm](https://github.com/nvm-sh/nvm), is a version manager allowing seamless Node runtime switches. A handy tool when juggling projects with varying Node version dependencies.

Yet, this time around, my experience with nvm-windows was less than stellar. The need for elevated privileges for every nvm command was cumbersome. Coupled with scant documentation on running the node command post-installation, I decided to pivot. Enter [Windows Sybsystem for Linux (WSL)](https://learn.microsoft.com/en-us/windows/wsl/about) and [Ubuntu](https://ubuntu.com/). My familiarity with nvm made this transition feel natural.

## WSL and Ubuntu: Setup Chronicles[<svg aria-hidden="true" focusable="false" height="16" version="1.1" viewbox="0 0 16 16" width="16"><path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path></svg>](#wsl-and-ubuntu-setup-chronicles)

On paper, setting up WSL should be a breeze, especially with Microsoft's comprehensive guide: [How to install Linux on Windows with WSL](https://learn.microsoft.com/en-us/windows/wsl/install). A simple `wsl --install` should suffice.

Reality, however, presented challenges. An obscure error message post-installation hinted at underlying issues. Delving deeper, I pinpointed the culprits: the Virtual Machine Platform and Windows Subsystem for Linux features were disabled. Here's how you can activate them:

1. Use the Windows start menu, searching for "Turn Windows features on or off".
2. Ensure the "Virtual Machine Platform" option is checked.
3. Similarly, enable the "Windows Subsystem for Linux" option.

A system reboot might be necessary post this change. For me, post-reboot, `wsl --install` worked flawlessly, allowing me to finalize my Ubuntu setup.

## Essential Development Tools on WSL[<svg aria-hidden="true" focusable="false" height="16" version="1.1" viewbox="0 0 16 16" width="16"><path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path></svg>](#essential-development-tools-on-wsl)

### Installing NVM[<svg aria-hidden="true" focusable="false" height="16" version="1.1" viewbox="0 0 16 16" width="16"><path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path></svg>](#installing-nvm)

The NVM installation is pretty simple. All one needs to do is use the install script and restart their terminal after the script runs. Check out the [Installing and Updating](https://github.com/nvm-sh/nvm#installing-and-updating) section of the README for more details.

### Installing Visual Studio Code and Extensions[<svg aria-hidden="true" focusable="false" height="16" version="1.1" viewbox="0 0 16 16" width="16"><path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path></svg>](#installing-visual-studio-code-and-extensions)

For the actual integrated development environment (IDE), I like to use [Visual Studio Code](https://code.visualstudio.com/) for my side projects these days. Getting it set up ended being extremely easy. The following extensions were suggested by the editor itself:

- [JavaScript (ES6) code snippets](https://marketplace.visualstudio.com/items?itemName=xabikos.JavaScriptSnippets)
- [WSL](https://marketplace.visualstudio.com/items?itemName=ms-vscode-remote.remote-wsl)

  - This plugin makes it very easy to use WSL as a development environment.

- [ESLint](https://marketplace.visualstudio.com/items?itemName=dbaeumer.vscode-eslint)
- [npm](https://marketplace.visualstudio.com/items?itemName=eg2.vscode-npm-script)
- [npm Intellisense](https://marketplace.visualstudio.com/items?itemName=christian-kohler.npm-intellisense)
- [Path Intellisense](https://marketplace.visualstudio.com/items?itemName=christian-kohler.path-intellisense)
- [PowerShell](https://marketplace.visualstudio.com/items?itemName=ms-vscode.PowerShell)

  - This was suggested because I opened a PowerShell script. PowerShell is my preferred terminal when using Windows.

- [Search node\_modules](https://marketplace.visualstudio.com/items?itemName=jasonnutter.search-node-modules)

## Wrapping Up[<svg aria-hidden="true" focusable="false" height="16" version="1.1" viewbox="0 0 16 16" width="16"><path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path></svg>](#wrapping-up)

In the face of adversity, there lies an opportunity. My unexpected system collapse, while initially a daunting hurdle, metamorphosed into an enlightening journey through the intricacies of setting up a development environment on Windows. I found myself not only reconstructing what was lost but fortifying and optimizing my setup with newfound knowledge.

Several key takeaways punctuated this experience:

1. **Backup Early, Backup Often** : The minimal data loss I encountered, despite a complete system meltdown, accentuated the importance of regular backups. A safety net I'd advise every developer to weave.
2. **Flexibility Over Frustration** : When familiar tools faltered, like my experience with nvm-windows, the ability to pivot and adapt by turning to alternatives such as nvm within WSL was invaluable. Embracing change, rather than resisting it, proved to be a more efficient approach.
3. **Deep Dive Into Errors** : Instead of skirting around error messages or seeing them as mere hindrances, treating them as guiding beacons helped. My endeavor with the WSL installation is a testament to how diving deep into errors can unravel their mysteries and pave the way for solutions.
4. **The Value of Comprehensive Tools** : The seamless transition to Visual Studio Code and its vast array of extensions highlighted the significance of versatile tools that adapt to varied developmental needs.
5. **Continuous Learning** : This entire episode underscored the fact that in the tech realm, learning is ceaseless. New challenges breed new solutions, and each stumbling block is but a stepping stone to greater understanding.

In retrospect, while I wouldn't wish for another system failure, I appreciate the silver linings of this episode. Not only did I emerge with a more robust development environment, but I also fortified my troubleshooting arsenal, ready for future challenges.

Here's to the unpredictable challenges of the tech world, and the myriad learning opportunities they cloak!