Having trouble running the npm run build command with vue-cli for production builds

Anticipated Outcome

Executing npm run build should generate the production-ready dist bundle that can be deployed on a specified device.

Current Scenario

Despite successful local builds, encountering errors when attempting to execute npm run build on an external platform (e.g., Digital Ocean VM or Heroku server).

Error Records

root@nodejs-lazyq-dev:/var/www/html/Vue# npm run build

> [email protected] build /var/www/html/Vue
> vue-cli-service build


⠴  Building for production...

 ERROR  Failed to compile with 1 error                                                                                                   09:29:00

 error  in ./src/assets/scss/_material-dashboard.scss

Module build failed (from ./node_modules/mini-css-extract-plugin/dist/loader.js):
ModuleBuildError: Module build failed (from ./node_modules/sass-loader/lib/loader.js):

@import "md/plugins/fullCalendar";
^
      File to import not found or unreadable: md/plugins/fullCalendar.
      in /var/www/html/Vue/src/assets/scss/_material-dashboard.scss (line 59, column 1)
    at runLoaders (/var/www/html/Vue/node_modules/webpack/lib/NormalModule.js:286:20)
    at /var/www/html/Vue/node_modules/loader-runner/lib/LoaderRunner.js:364:11
    at /var/www/html/Vue/node_modules/loader-runner/lib/LoaderRunner.js:230:18
    at context.callback (/var/www/html/Vue/node_modules/loader-runner/lib/LoaderRunner.js:111:13)
    at Object.asyncSassJobQueue.push [as callback] (/var/www/html/Vue/node_modules/sass-loader/lib/loader.js:55:13)
    at Object.done [as callback] (/var/www/html/Vue/node_modules/neo-async/async.js:7974:18)
    at options.error (/var/www/html/Vue/node_modules/node-sass/lib/index.js:294:32)

 @ ./src/material-dashboard.js 17:0-48
 @ ./src/main.js
 @ multi ./src/main.js

 ERROR  Build failed with errors.
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! [email protected] build: `vue-cli-service build`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the [email protected] build 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!     /root/.npm/_logs/2018-09-03T09_29_01_030Z-debug.log

I've also attempted running npm rebuild node-sass, updated the file name from material-dashboard.css to include the underscore: _material-dashboard.css, and including --production in npm install --production. However, none of these solutions have been effective so far.

nodejs version: v8.11.4 npm version: v5.6.0

I've devoted several hours to troubleshooting this issue without success. The discrepancy between local functionality and failure on a remote production environment remains puzzling.

Answer №1

The issue is caused by a typo in the import statement for the Vue UI library. The file is named "fullcalendar" but the import is looking for "fullCalendar" with a capital "C". Simply correcting the case of the letter in the import statement will allow the "npm run prod" command to execute successfully. Interestingly, this issue only occurred for me in the Linux environment and not on Windows.

Similar questions

If you have not found the answer to your question or you are interested in this topic, then look at other similar questions below or use the search

What guidelines should be followed for utilizing jQuery's Ajax convenience methods and effectively managing errors?

Imagine a scenario where I am trying to mimic Gmail's interface using jQuery Ajax to incorporate periodic auto-saving and sending functionalities. Error handling is crucial, especially in cases of network errors or other issues. Instead of just being ...

Ways to update HTML content generated by Ajax

Having some difficulties modifying the HTML content generated by AJAX. This is the code snippet from the page: @model IEnumerable<WE_SRW_PeerNissen.Models.Reservations> @{ ViewBag.Title = "List"; Layout = "~/Views/Shared/_Layout.cshtml"; } ...

Choose to either push as a single object or as individual items

I have a quick question that I'd like to get some clarity on. Can someone explain the distinction between these two code snippets: export const addToCart = function(product, quantity){ cart.push({product, quantity}); console.log(`${quantity} ...

Firefox is giving me trouble with my CSS/JS code, but Chrome seems to be working

Having some trouble with this code - it seems to be working fine in most browsers, but Firefox is giving me a headache. I've tried using the moz abbreviations in CSS and JS tweaks, but no luck. Is there a property that Mozilla Firefox doesn't sup ...

Updating a MongoDB document using only the data from checked checkboxes

Imagine having data structured like this: _id:60e2edf7014df85fd8b6e073 routineName:"test" username: "tester" monday:[{ _id: 60e430d45395d73bf41c7be8 exercise: "a" }{ _id: 60e4329592e ...

Images flicker as they transition

Within my HTML body, I have the following: <a id="Hal9000"> In addition, there is a function included: function Hal(MSG){ document.getElementById("Hal9000").innerHTML = "<img src=\"+preloadImage("HAL9000.php?Text="+MSG)+"\"\>" ...

Installing Node.js from local files is a straightforward process that allows users

After making changes to an npm package on my computer, I am looking to install the updated version globally along with its dependencies. What is the best way to achieve this? ...

Encountering an unidentified entity within a ReactJS application

Within a container, I've included a search bar inside a form element with two inputs - from and to, along with a submit button. Upon submitting the form, I create an OBJECT named query which looks like this: const query = { from : this.s ...

Issue with AJAX and JavaScript persisting upon second attempt

My website uses jQuery to load the app page into a div on the index page. The app page consists of two DIVs: a search form and a results div. When the user searches, jQuery loads the results into the results div. Each result includes call-to-action butto ...

The command 'initiate-tale' is not acknowledged as an internal or external command

PS C:..project\src\features> npm run storybook > <a href="/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="4b3247507548545c405d58576e424a4a4659">[email protected]</a> storybook > start-storybook -p 6006 ...

Assistance with organizing date schedules using Javascript

I'm currently assisting a friend with his small project, and we've run into an interesting situation. Imagine a scenario where a doctor informs their patient that starting today, they have X number of consultations scheduled for every Wednesday a ...

Tips for updating multiple fields in Prisma ORM

Is there a way to upsert multiple fields in Prisma ORM using just one query? I'm looking for a solution that allows me to upsert all fields at once, without having to do it individually. Is this possible? ...

Creating a dynamic array of objects in a .Net Core form

I am in the process of creating a form using .Net Core 2 that includes a List of objects. Here is an example of the form: public class InsuranceForm { public IList<WindowModel> Windows { get; set; } } public class WindowModel { public string ...

modify the navigation when router events are triggered

Is there a way to modify the destination route after the router events have been triggered in an Angular app? I am trying to implement a functionality where if the user clicks the browser back button, the navigation is redirected to the home page. However, ...

Vue.js tutorial: Adding a question mark to the URL when submitting a login form

There have been some strange issues with my login form recently. It initially directs me to However, when I try to log in, instead of logging me in, it redirects me to: I can only successfully log in after clicking on the login button again. What could ...

Chrome is experiencing a delay in closing the Select Option dropdown menu

On my webpage, I have two select option buttons placed on different tabs. Whenever one button is changed, I want to update the value of the other button and assign it to a specific element like a span in the example code provided. While everything works sm ...

The pinia state value fluctuates as the muted props value shifts

I have encountered an issue in my application where I utilized the Pinia store and event emit implementation to mutate props value from a child component to its parent. However, both values are now reactive, causing changes in one to reflect in the other. ...

`How can you adjust the language preferences for users in Meteor?`

My website is internationalized using the tap-i18n plugin. I am looking to allow users to switch between languages on the site. Currently, I have a file called client/setLanguage.js where I set the language on startup: getUserLanguage = function () { ...

Click on the navigation bar buttons to toggle between different divs and display multiple information boxes simultaneously

Here is the current code snippet... $("#contact").click(function() { if ( $( "#contact_div" ).length ) { $("#contact_div").remove(); } else { var html='<div id="contact_div" class="contact-info"><p>Contact info</p&g ...

How to detach functions in JavaScript while preserving their context?

Can functions in JavaScript be detached while still retaining access to their context? For instance, let's say we have an instance of ViewportScroller called vc. We can retrieve the current scroll position with the following method: vc.getScrollPosi ...