TypeError: require.extensions.hasOwnProperty is not a function

While playing with https://github.com/alexa/interactive-adventure-game-tool, I ran into following error: > interactive-adventure-game-tool@1.0.0 start /Users/amer/alexa/interactive-adventure-game-tool > node node_modules/gulp/bin/gulp.js /Users/amer/alexa/interactive-adventure-game-tool/node_modules/require-dir/index.js:97 if (!require.extensions.hasOwnProperty(ext)) { ^ TypeError: require.extensions.hasOwnProperty is not a function at requireDir (/Users/amer/alexa/interactive-adventure-game-tool/node_modules/require-dir/index.js:97:37) at Object.<anonymous> (/Users/amer/alexa/interactive-adventure-game-tool/gulpfile.js:1:85) at Module._compile (module.js:660:30) at Object.Module._extensions..js (module.js:671:10) at Module.load (module.js:573:32) at tryModuleLoad (module.js:513:12) at Function.Module._load (module.js:505:3) at Module.require (module.js:604:17) at require (internal/module.js:11:18) at Liftoff.handleArguments (/Users/amer/alexa/interactive-adventure-game-tool/node_modules/gulp/bin/gulp.js:116:3) npm ERR! code ELIFECYCLE npm ERR! errno 1 npm ERR! interactive-adventure-game-tool@1.0.0 start: `node node_modules/gulp/bin/gulp.js` npm ERR! Exit status 1 npm ERR! npm ERR! Failed at the interactive-adventure-game-tool@1.0.0 start script. npm ERR! This is probably not a problem with npm. There is likely additional logging output above. npm ERR! A complete log of this run can be found in: npm ERR! /Users/amer/.npm/_logs/2018-01-02T05_12_24_832Z-debug.log The solution was to update require-dir to version 0.3.2 in package.json and run npm install again. ...

May 8, 2021 · 1 min · Amer Khalid

Troubleshooting Kubernetes Ingress

Setting up Ingress is an easy process but when it doesn’t work it gets really painful. First, make sure you have Ingress Controller setup correctly. This is in addition to Ingress resource and should be automatically setup by your cloud provider. When I was trying to setup a Kubernetes cluster on IBM Cloud, I ran into a lot of issues. It seems due to my permissions level something went wrong during provisioning of Kubernetes and Ingress Controller was not setup correctly. I went through a lot of steps including recreating alb , ingress resources, etc. The final fix was to login to IBM Cloud as superuser to change Access Policies for the cluster. Once did that, everything just worked magically. ...

May 4, 2021 · 1 min · Amer Khalid

iPad Pro as main machine after 2 years

I got my iPad Pro at the end of 2017. Before buying it, I had read many blog posts by various developers who were using iPad for programming and web development. But soon after I bought it, I realized that serious web development on iPad is hard. The biggest issue was debugging JavaScript and CSS without web tools. At first, I was having buyer’s remorse but I loved the form factor of iPad and loved drawing on it. I am used to reading on Kindle and iPad was just too heavy for long reading sessions but it was very decent reading device for quick reading sessions. So I kept it. ...

June 26, 2020 · 2 min · Amer Khalid

Git Simplified

One of most common technology that new professional developers struggle with is git. Many junior developers are eager to start using all of the powerful commands of git and usually end up getting more confused. Here are a few commands that I recommend to anyone learning git for the first time: clone This downloads entire git repo from a remote server, usually. You will get all revision history and branches. ...

May 25, 2019 · 3 min · Amer Khalid

Tools of Trade

I use 13-inch MacBookPro for personal projects and 15-inch for work. My personal MBP would be last traditional laptop, hopefully. Since most of my work can easily be done on Linux VPS. I have been using 10.5-inch iPad Pro with Blink shell for most my side projects. I like the form factor of iPad Pro and I am getting better at Linux administration. Now I am also setting up Docker images so I can bring up new images as needed. ...

March 25, 2019 · 2 min · Amer Khalid

You don't need a web developer

Occasionally, when people find out I am a programmer, they ask me if I will build them a website or an app on the side. As I spend all day programming at my work, I rarely have motivation to continue programming after work. However, talking to most people, I realize they don’t need a programmer; most of their needs can be met by a simple SaaS solution. Recently, I directed a few friends to WordPress.com, SmugMug, Shopify, etc. They all were happy with the results and ease of use. Also I am glad they talked to me because one guy was ready to spend a few thousands on a developer for a WordPress-based site. ...

December 4, 2017 · 3 min · Amer Khalid

WordPress vs Hugo

Managing WordPress can get time consuming. I have tried to move to static website several times but kept going back to WordPress. But there are several advantages of static sites generators that I finally moved for good. I am also advising a lot of my clients to use Hugo especially when they know that they will rarely ever update their sites. Here are some of main advantages of Hugo (or other static site generators) vs WordPress and other CMS. ...

December 2, 2017 · 4 min · Amer Khalid

iPad Pro for Programming & Fun

I finally bought 10.5" iPad Pro (Affiliate Link). It was mostly an impulse purchase. When first I started to use iPad, it felt blah. It is hard to find good apps or what apps you might want to try out. My main goals with iPad was to have a really small laptop replacement. So I was hoping for a decent code editor. There are some code editing apps but there is no way to try them out before purchasing. So I am spending a lot of time reading reviews before I purchase any app. ...

November 14, 2017 · 4 min · Amer Khalid

ReflectionException: Class Tests\Unit\Symfony\Component\HttpKernel\Exception\NotFoundHttpException does not exist

Running unit tests in Laravel, I was getting this error: ReflectionException: Class Tests\Unit\Symfony\Component\HttpKernel\Exception\NotFoundHttpException does not exist The issue was missing root backslash, make sure you have expected exception like: $this->expectException(\Symfony\Component\HttpKernel\Exception\NotFoundHttpException::class);

October 13, 2017 · 1 min · Amer Khalid

Upgrading to PHP 7.0 on Ubuntu 14

I upgraded PHP to version 7.0 on Ubuntu box. Running php -v on shell would show it as version 7.0. But Apache was still using PHP 5.6. I tried various methods to update settings for Apache but nothing worked until I issued following commands: sudo a2dismod php5.6 sudo a2enmod php7.0 sudo service apache2 restart Source: PHP 7.0 (and 5.6) on Ubuntu | LornaJane

September 22, 2017 · 1 min · Amer Khalid