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.