All Articles

The Tragedy of Running an Old Node Project

Sad stick figure next to gatsby logo

Updating my website

It’s been a long while since I wrote anything on this site. The framework I used was Gatsby which in 2020 was one of the hot ways of getting a good looking blog up and running quickly. With over 41 dependencies, and god knows how many more sub-dependencies, this thing was a beast.

Time to run it after not touching it for nearly 4 years.

How hard could it be to run an old node project?

Pretty hard actually.

npm install

<1000 lines of red and failures later>

Failure could not find python2...

What? Why do I need python2 to install a node package. What’s it doing? Do I have python2? There probably something wrong with this old node_modules folder. Let me delete it.

rm -rf node_modules/
npm install

...

Failure could not find python2

Okay, you win. I’ll install python2 even though this is ridiculous.

…

30 mintues later after fiddling with installing python2 using pyenv, hoping to not ruin my python3 setup, I finally got python2.

The complexity grows. What am I getting myself into

npm install

...

npm remove_cv_t’ is not a member of ‘std’; did you mean ‘remove_cv’

What? That looks like C, or maybe C++. Why the heck is C++ code building so that I can install some node packages that just manage basic web files.

Some Google searching and I land on a GitHub issues page for node-gyp and apparently my C++ version is below 14. That does not seem right. I’ve got to have something really wrong because I’m down the wrong path.

Then it dawns on me. Do I have the right node version or is there another one I used 4 years ago back in 2020? The only one in my node version manager is v16.

I tried doing some Googling on how to know what node version was used in a package.json. Turns out you can’t unless the project specifically sets it.. and I didn’t. Great.

Now all I’m thinking is “Please let me find this node version because I don’t want to start over with this blog site.” Then I stumble upon another GitHub issues page facing a similar C++ compile error. And they mention a broken build using v12.3 and the user should revert back to v12.2

I install node v12 and everything works.

Two hours of my life gone, just to pick up where I left off.

I’m tired and going to bed.