TL;DR version: if you’re using webpack for a project and you’re getting this in the CLI (note the error on the last 3 lines) with yarn build or yarn run:

Bash
Yarn run v1.22.5
$ webpack --progress --config resources/assets/build/webpack.config.js
/bin/sh: /Users/giantpaper/Sites/~giantpaper.org/site/web/app/themes/giantphotos-2020/node_modules/.bin/webpack: Permission denied
error Command failed with exit code 126
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.

There might be a problem with your CSS/JS compiler (whatever you have in your package.json file under scripts for that particular command). In that case, you should delete your node_modules folder and reinstall yarn packages with yarn.

Long version: So…those Rank Math turds I mentioned last time? They appeared on my local development site (of GPORG) too, since I was running Rank Math on my local site. 😭 I tried using the SQL version of str_replace, but that only replaced ALL the post_content fields with the string ‘post_content’. So, on my local site, all every single blog post, page, photo, etc now had the string ‘post_content’. This changed all the old revisions of each of each post_content so it wasn’t like I couldn’t just restore them.

(BTW, before doing major changes like this, always backup your database, so if something goes wrong like the above, you can restore it. You’d think I would’ve done the same, but I thought ‘what could go wrong?’ The answer? EVERYTHING.)

And for a while, I thought ‘🥴 This is fine.’

But then I realized since I was so particular about how the Gutenberg blocks appear on the site, maybe I would want them available on the dev site too? And the best way to do that would be to have the same copy from the live site on the dev site.

Fixing the ‘post_content’ problem:

I was able to fix the problem of ‘post_content’ appearing in every post_content field by using Duplicator to create a package of the live site and basically use that to create a clone on the dev version. There was some problems of trying to get WordPress to use the Roots Bedrock version I already installed, rather than the vanilla version Duplicator installed, but if this happens, make sure /index.php in your site’s root folder is the same one used for Bedrock. I just downloaded the one from the live site and the sit was back to normal…sorta.

Fixing ‘yarn build’ or ‘yarn run start’ not working:

So, the above error? I couldn’t figure out what to do about that. I downloaded all the files from the live site, so it should be working…right?

NOPE.

The link it gave told me nothing. And looking up the error online also told me nothing. I went to bed, figuring I could solve it in the morning.

RIGHT WHEN I woke up, I had this thought:

I could redownload Bedrock and then Sage, and c a r e f u l l y transfer my current them to the new Sage theme. And it should work, right???

But when I got my computer, I had the thought to do the much simpler method (delete ./node_modules and run yarn in the CLI), and as you know, it worked.

(If that didn’t work, I would’ve done the more complicated method, but luckily, it never came to that.)

– THE END –