Module not found: Can't resolve '@fortawesome/fontawesome-svg-core' (VueJS + FontAwesome)

Issue

I am trying to upgrade my Font Awesome version from 4.0.7 to 5.0.12 following this tutorial: https://blog.logrocket.com/full-guide-to-using-font-awesome-icons-in-vue-js-apps-5574c74d9b2d/. However, I am getting the error Module not found: Error: Can't resolve '@fortawesome/fontawesome-svg-core' in '/project/src/plugins'.

I have installed the dependencies and added the following code:

src/plugins/font-awesome.js

import Vue from 'vue'

import { library } from '@fortawesome/fontawesome-svg-core'
import { faCoffee } from '@fortawesome/free-solid-svg-icons'
import { FontAwesomeIcon } from '@fortawesome/vue-fontawesome'

library.add(faCoffee)

Vue.component('font-awesome-icon', FontAwesomeIcon)
main.js

/* ============
 * Plugins
 * ============
 *
 * Import and bootstrap the plugins.
 */

import './plugins/vuex';
import './plugins/axios';
import { i18n } from './plugins/vue-i18n';
import { router } from './plugins/vue-router';
import './plugins/vuex-router-sync';
import './plugins/bootstrap';
import './plugins/font-awesome';
import './plugins/moment';
import './plugins/vuelidate';
import './plugins/scrollto';
import './plugins/filters';
import './plugins/casl';

The folder exists in node_modules, but I am still getting the error. Is there any other approach I can try to solve this?

The error Module not found: Error: Can't resolve '@fortawesome/fontawesome-svg-core' in '/project/src/plugins' suggests that the @fortawesome/fontawesome-svg-core module could not be found.

To solve this, try running the following command in your project directory to install the missing module:

npm install @fortawesome/fontawesome-svg-core

After installation, try running your application again.