Cannot find module ‘vue/dist/vue.esm’

I just created a new rails + vue.js app, but Vue is throwing an error in the browser console and does not populate the data in {{message}}

I’m using VS Code on Windows and I followed this guide: https://medium.com/swlh/how-to-integrate-vue-js-with-rails-6-5bd4c6263b18

The browser console shows this error: Uncaught SyntaxError: Unexpected token '!'

and references the following JS code:

!(function webpackMissingModule() { var e = new Error("Cannot find module 'vue/dist/vue.esm'"); e.code = 'MODULE_NOT_FOUND'; throw e; }()).use(vue_turbolinks__WEBPACK_IMPORTED_MODULE_0__["default"]);
document.addEventListener('turbolinks:load', function () {
  var app = new !(function webpackMissingModule() { var e = new Error("Cannot find module 'vue/dist/vue.esm'"); e.code = 'MODULE_NOT_FOUND'; throw e; }())({
    el: '#hello',
    data: function data() {
      return {
        message: "Can you say hello?"
      };
    },
    components: {
      App: _app_vue__WEBPACK_IMPORTED_MODULE_2__["default"]
    }
  });
});
...