Monday, February 26, 2018

Angular CLI Upgrade 'Cannot find module' Error

Every couple months I try to upgrade to the latest version of the Angular CLI and every time I run into this error.

Cannot find module 'webpack/lib/dependencies/ContextElementDependency'
Error: Cannot find module 'webpack/lib/dependencies/ContextElementDependency'
    at Function.Module._resolveFilename (module.js:469:15)
    at Function.Module._load (module.js:417:25)
    at Module.require (module.js:497:17)
    at require (internal/module.js:20:19)
    at Object.<anonymous> (C:\Users\\node_modules\@ngtools\webpack\src\plugin.js:8:34)
    at Module._compile (module.js:570:32)
    at Object.Module._extensions..js (module.js:579:10)
    at Module.load (module.js:487:32)
    at tryModuleLoad (module.js:446:12)
    at Function.Module._load (module.js:438:3)

Every time I realize I miss a step so I want to document the steps I ended using so I don't have to search for the solution again.  All the steps below are recommended by the Angular CLI Upgrade page, except the highlighted step below that removes the package-lock.json file.

Global install upgrade
NPM will keep a globally installed version of the Angular CLI that will be used across the system. It is updated using these steps, which will uninstall the current version and then install the new version.

npm uninstall -g @angular/cli
npm cache verify
# if npm version is < 5 then use `npm cache clean`
npm install -g @angular/cli@latest

Local install upgrade
The Angular project itself will have its own version of the CLI installed in the node_modules folder of the project.  It is updated using these instructions, which will remove the node_modules directory, update the version of the dependency in package.json and then reinstalls all the dependencies.  

rm -rf node_modules dist 
rm package-lock.json # deletes the package.json lock file
npm install --save-dev @angular/cli@latest
npm install

Friday, February 2, 2018

Windows 10 Hyper-V and Samsung 960 SSD Issue

I was following these great instructions, How to Create a Linux VM Using Hyper-V and when I got to the part where you actually create a new VM the computer frozed and restarted.  I tried this a couple more times with the same result.  I did a quick Google search and found this, Microsoft Forum Discussion on Samsung NVME Driver Issue .

In summary there was an issue with the Samsung Storage Controller driver version 2.1 that was causing the OS to crash when creating a new VM using Hyper-V.  You can check your current driver version by
1. Go to Start
2. Search for Device Manager
3. Expand the Storage Controllers node in the Device Manager
4. Double click on Samsung NVMe Controller to launch the details
5. Go to the Driver page and look at the Driver version.

The good news is that Samsung has released a fix for the issue with version 2.2 which you can download directly from Samsung at (just go to the Driver section for the installer and instructions).

After running the installer and restarting my machine the Hyper-V Manager successfully created my new VM.

Tuesday, January 23, 2018

An iOS Laptop

The one device I would like Apple to release in 2018 is a laptop that runs iOS. I have been thinking about this a lot since reading Jason Snell’s piece at MacWorld, Why Apples Next Laptop Should Run iOS and the related discussion on Upgrade #168: Hail Hydrant. The addition of the Files app and better multi tasking in iOS 11 has made the iPad an even better alternative for those looking to get rid of their Windows or Mac laptop. However, I haven’t seen a lot of people switching out there laptops for an iPad, but instead moving towards Windows or Chrome OS convertible devices. I think the tablet form factor of the iPad combined with some out of date understanding of the capabilities of iOS coupled with the adoption of Chromebooks in schools is keeping people from making the switch.

It seems strange, but I think one of the big things keeping the iPad out of the conversation is the tablet form factor. If a person is looking to replace their old laptop or desktop they look at the iPad and it just does not seem like a replacement because it is perceived as just a tablet. They may see the Smart Keyboard attached to it in the store, but that is just an accessory for a tablet. People seem to have an association with the first class keyboard and a “main” computing device. The laptop form factor provides an extra level of comfort and consistency users may not feel with a tablet. The Smart Keyboard is also limited to being used on hard surfaces, which might also turn some people off.

The next thing holding back the iPad as a person’s main computer is the misconception that you can’t do a lot of “computer” things on them. It is probably just a hold over from the early days of the iPad when it was the next big thing and not only was the operating system pretty limited, but the quality of apps in the app store was also very low. Most people held on to their iPad 1 or iPad 2 for several years and never got to experience the more powerful iPads of the last few years or the new crop of apps that pushed the limits of tablet computing. If it was not for the last two years of daily iPad use and hours of podcasts helping me retrain my brain to work with a different style OS, I might also disregard the iPad Pro too.

Chromebook adoption in school’s could also be a factor as children start to get their own devices at home. My son has been using Chromebooks in school for a couple years now and has become very proficient navigating Chrome OS. Last fall, his homework required a device at home and he asked for a Chromebook. After a little research I found that while the low end Chromebooks are cheap; in order to get something with a little more longevity and higher quality you have to spend quite a bit of money. I briefly considered getting a MacBook for him, but then realized if anybody could make an iPad work for his tasks it was my son. I explained to him how his iPad Air could do all of the things the Chromebook could do and more. Of course the lack of a keyboard was an issue so I bought the Element Digital bluetooth keyboard case and despite the smaller keys he is quite happy with his setup. Unfortunately I think we are the exceptional case and most parents would purchase a $200 Chromebook and call it a day instead of spending twice as much for an iPad and a keyboard.

The combination of iOS and the iPad is now mature enough to be used by most people as their non-smartphone device. The first step Apple should take is to create an iOS device with a more familiar laptop form factor for iOS. The device would still support touch for some activities, but the keyboard would be the main input device. It would require a little more polish to keyboard shortcut on iOS, but for the most part it should be compatible out of the box. The next part is a bit trickier and involves Apple getting the word out that iOS on iPad can now do much more than it could back in the iOS 5 days when they owned their first iPad. Finally the new lower price point for the regular iPad should help make the iOS on iPad experience much more affordable when compared to other devices and the iPad Pro. I am convinced that iOS is the future of Apple devices and now is the time to start to expand beyond the old tablet form factor and into more interesting form factors like a 13” laptop or maybe even something as boundary pushing as a 21” desktop machine.

Friday, January 5, 2018

Work From Home Difficulties

Yesterday we received over a foot of snow, so unlike previous years I decided to work from home.  It is nice that I have a space upstairs that is somewhat separated from my families, although it isn't in a room where I can close the door and I can hear all the goings on elsewhere in the house.  Thankfully I can play music while I work and this blocks out that noise.  The harder thing is trying to work on the 22" inch monitor at home, because it has about a quarter of the pixels of my 28" 4K monitor at work.  I immediately feel so claustrophobic and struggle to get used to the space.  The only other difficulty is that I only have Apple keyboards at home so my brain has to remap some of the key combinations. 

Thankfully we only get a few storms like this a year and for the most part I stick to working in the office.  I'm not sure if maybe I should practice more, by spending a day at home every other week.

Monday, December 11, 2017

iPad Pro Productivity Apps

Since buying an iPad Pro way back in 2015 I have come to rely on a few different apps for my day to day use at work and for my creative endeavors at home.
My Current Home Screen

Note Taking

I played around with a few note taking apps in the beginning, but settled on Good Notes 4 for a few different reasons.  First and foremost it has great Apple Pencil support and includes a neat feature that lets you lasso text and move it around, which is helpful if your writing style is a little messy and sparse.  My favorite feature is that you can import PDF files from a number of file providers like OneDrive, Google Drive, DropBox or in iOS 11 the Files app.  Once imported you can mark the documents up and then export them back to any provider you want.  The app has the concept of categories to keep you organized and has the concept of notebooks with all different types of paper to choose from.


iOS apps have always been sandboxed since day one and this limits the interactions you can do between apps.  In iOS 8 the concept of app extensions was introduced which let developers create extensions allowing one app to open content in a different app.  The Workflows app, which Apple bought within the last year, lets you do lots of different tasks across multiple apps.  You create a workflow and then using a building block interface construct a workflow that can get a distance from the Maps app and plug it into a prebuild text message for sending.  You can add data to the health kit app or do more complex things using web services.


Managing my web server from the iPad is done easily using Coda.  The app includes the ability to configure multiple FTP servers, with great text editing tools and an SSH client when you need to update something remotely.  The text editor supports lots of different syntax formats, which is useful when editing on your mobile device.

File Providers

I have my files spread across multiple file providers like DropBox, Google Drive, OneDrive and iCloud Drive. Once you install any of these apps the built in Files app will gain access to the files and you can quickly access them from any apps that properly integrate with Files.  

Miscellaneous Apps

Here are some other apps I use on a regular basis:
  • Ferrite - Podcast recording studio
  • Overcast - Podcast listening app
  • Microsoft Remote Desktop - Sometimes you need to access your Windows machine
  • Byword - Markdown editor
  • PCalc - A calculator because the iPad doesn't come with one, plus this developer has lots of easter eggs in it.
  • iMovie - Movie editor because my Macs are too old to edit 4K
  • Tweetbot 4 - My favorite Twitter client
  • Inbox by Gmail - Keeping the dream of inbox zero alive.

Monday, October 16, 2017

iCloud Photo Library Optimize Storage Issues

I was trying to use the Apple Clips app the other day to make a quick movie from some short ~10 second videos I had shot on my iPhone 6s an hour earlier.  I went to the Library tab, tapped on one of the videos and it popped up the "Downloading from iCloud..." progress bar.  It seemed odd that it had to go to the cloud to for such a recent video.  I was really curious so I went to the Photos app, went to a different video and tapped on the edit button to see if the video was stored locally, but it wasn't as I saw the little progress circle showing it downloading.

My iPhone has the "Optimize Storage" setting turned on for iCloud Photo Library and I have over 22GB of space available.  Is this a bug in iOS 11 or has something changed in how the "Optimize Storage" behavior?

Tuesday, October 10, 2017

World Mental Health Day: My Anxiety Story

Today is World Mental Health Day so I wanted to share my story about anxiety:

Four years ago, I went out to lunch like normal, but I started to feel nauseous and was unable to finish my meal.  Later in the day when I was in the office I felt dizzy and short of breath.  It was very strange since I had never felt this way before.  After this happening for a few more days I decided to go and see my doctor.  I was sent for a few blood tests and then wore a heart monitor for a day, but nothing turned up.  In my follow up appointment my doctor diagnosed me with anxiety and referred me to a therapist that specialized in the treatment of anxiety.

Prior to this I never thought of myself as somebody that would need to see a therapist, because I thought just being smart and strong would get me through any problem.  It was also surprising that somebody like me that is so outgoing and friendly would have anxiety.  However, at that moment in time I just wanted to get better and didn't think twice about it.  I contacted the therapist and after a brief phone screening had my first appointment.  The first few weekly appointments went as expected with lots of talk about my history, family and my current life.  It wasn't long though before the homework began and we started to tackle some of my anxiety issues.

My therapist follows the Cognitive and Behavioral Therapy ( approach for treating anxiety and doesn't prescribe medication.  So my first job was to figure out situations that made me anxious, like going out to lunch or visiting a crowded place.  We would then list out those things and then I would have to go experience them and afterwards document how I felt while doing them.  I think my analytical mind really enjoyed this type of feedback loop and trying to correlate map activities to their outcome.  All of the documenting was done using Google docs so I can go back today and see all of the different tasks I had to complete and all of the improvements and sometimes setbacks I faced.

After about a month I started to make progress with eating out at lunch and started to feel much better in general.  However, it turns out this was just the tip of the iceberg for my anxiety, because once we started to talk it became clear that anxiety had affected me in many other ways throughout my life.  I started to recall panic attacks I had at different large public events, small fears I had about checking into hotels, migraines from the anxiety associated with air travel (thanks TSA), meeting new people and many others I won't bore you with today.

Slowly over the last four years I tackled one problem after another and started to recognize my anxieties and then how to best deal with the situations causing it.  It hasn't been easy and I have definitely gone into more than one exposure that pushed me to my limit, but today I am so much stronger and happier because of my treatment.  I feel there is such a stigma associated with going to therapy, but it has actually made me open about the fact that I do go and how much it has helped me.  It has really changed my life and if you have ever considered seeking help, but were worried about what people might think, just do it!

Special thanks to my therapist, my family and of course my amazing wife for supporting me through all of this.