I’ve been wanting to blog my technical journey for some time but wasn’t sure which platform to settle on. I could just get a Wordpress hosted site and be done with it, but my blogging requirements are modest, and I want to advance my technical knowledge at the same time.

I was looking to accomplish 3 things:

  • Become more proficient at using Markdown
  • Learn how to use a static page generator
  • Expand my experience with Node

Over the weekend my friend, Nathan, told me about the Netlify service, so that set me in motion. Given my requirements, I settled on Hexo for my static site generator since it is written in Node and uses Markdown.

I like that I can make my changes and push them to my Git repository and have them pulled by Netlify to be published in less than a minute.

As far as cons go, while the plugin page is extensive, it is difficult to wade through the dozens of plugins available to find the valuable workhorse add-ons that I need. Also, many (or maybe even most) of them plugins are oriented around Chinese users.

I was able to get the blog up and running quickly, but after pushing several minor changes I ran into this error:

7:45:45 PM: Error: Cannot find module 'fs.realpath'
7:45:45 PM:     at Function.Module._resolveFilename (module.js:538:15)
7:45:45 PM:     at Function.Module._load (module.js:468:25)
7:45:45 PM:     at Module.require (module.js:587:17)
7:45:45 PM:     at require (internal/module.js:11:18)
7:45:45 PM:     at Object.<anonymous> (/opt/build/repo/node_modules/glob/glob.js:44:10)
7:45:45 PM:     at Module._compile (module.js:643:30)
7:45:45 PM:     at Object.Module._extensions..js (module.js:654:10)
7:45:45 PM:     at Module.load (module.js:556:32)
7:45:45 PM:     at tryModuleLoad (module.js:499:12)
7:45:45 PM:     at Function.Module._load (module.js:491:3)
7:45:45 PM:     at Module.require (module.js:587:17)
7:45:45 PM:     at require (internal/module.js:11:18)
7:45:45 PM:     at Object.<anonymous> (/opt/build/repo/node_modules/stylus/lib/utils.js:17:12)
7:45:45 PM:     at Module._compile (module.js:643:30)
7:45:45 PM:     at Object.Module._extensions..js (module.js:654:10)
7:45:45 PM:     at Module.load (module.js:556:32)

Being new to the framework, I carefully examined the handful of commits that I had made, even reverting text changes like the name of the blog. I wasn’t able to track it down, so I tried installing a fresh copy. I was able to break the site again after just one commit

A little searching turned up this StackOverflow page with the following comment:

So you should always commit at least one of yarn.lock or package-lock.json depending on which package manager you’re using.

It appears that I am using npm to build the site, and so I don’t need the yarn.lock file as long as I have package-lock.json. Once I removed the yarn lock file the system built again nicely, and I was able to quickly re-apply the earlier changes I made.