Topic: Cannot find module 'node-sass'

ivargas tesabiz pro asked 3 years ago


Good morning, I have a problem with a project done with (MDB Pro + Admin Template - Angular). The project was uploaded to our local repository, with the success of the npm install command, but when you want to do the deployment with the ng serve command, several errors are displayed, one of them is' ERROR in ./src/app/template/menu/ menu.component.scss Module build failed (from ./node_modules/@angular-devkit/build-angular/node_modules/sass-loader/lib/loader.js): Error: Cannot find module 'node-sass'

Expected behavior

Actual behavior

ERROR in ./node_modules/@fortawesome/fontawesome-free/scss/fontawesome.scss (./node_modules/@angular-devkit/build-angular/src/angular-cli-files/plugins/raw-css-loader.js!./node_modules/postcss-loader/src??embedded!./node_modules/@angular-devkit/build-angular/node_modules/sass-loader/lib/loader.js??ref--14-3!./node_modules/@fortawesome/fontawesome-free/scss/fontawesome.scss) Module build failed (from ./node_modules/@angular-devkit/build-angular/node_modules/sass-loader/lib/loader.js): Error: Cannot find module 'node-sass'

Resources (screenshots, code snippets etc.) ERROR in ./src/styles.scss (./node_modules/@angular-devkit/build-angular/src/angular-cli-files/plugins/raw-css-loader.js!./node_modules/postcss-loader/src??embedded!./node_modules/@angular-devkit/build-angular/node_modules/sass-loader/lib/loader.js??ref--14-3!./src/styles.scss) Module build failed (from ./node_modules/@angular-devkit/build-angular/node_modules/sass-loader/lib/loader.js): Error: Cannot find module 'node-sass' Require stack: - /home/rsalgado/proyects/bmproyect/source/node_modules/@angular-devkit/build-angular/node_modules/sass-loader/lib/loader.js - /home/rsalgado/proyects/bmproyect/source/node_modules/loader-runner/lib/loadLoader.js - /home/rsalgado/proyects/bmproyect/source/node_modules/loader-runner/lib/LoaderRunner.js - /home/rsalgado/proyects/bmproyect/source/node_modules/webpack/lib/NormalModule.js - /home/rsalgado/proyects/bmproyect/source/node_modules/webpack/lib/NormalModuleFactory.js - /home/rsalgado/proyects/bmproyect/source/node_modules/webpack/lib/Compiler.js - /home/rsalgado/proyects/bmproyect/source/node_modules/webpack/lib/webpack.js - /home/rsalgado/proyects/bmproyect/source/node_modules/@angular-devkit/build-webpack/src/webpack/index.js - /home/rsalgado/proyects/bmproyect/source/node_modules/@angular-devkit/build-webpack/src/index.js - /home/rsalgado/proyects/bmproyect/source/node_modules/@angular-devkit/build-angular/src/dev-server/index.js - /home/rsalgado/proyects/bmproyect/source/node_modules/@angular-devkit/architect/src/architect-legacy.js - /home/rsalgado/proyects/bmproyect/source/node_modules/@angular-devkit/architect/src/index.js - /home/rsalgado/proyects/bmproyect/source/node_modules/@angular/cli/models/architect-command.js - /home/rsalgado/proyects/bmproyect/source/node_modules/@angular/cli/commands/build-impl.js - /home/rsalgado/proyects/bmproyect/source/node_modules/@angular-devkit/schematics/tools/export-ref.js - /home/rsalgado/proyects/bmproyect/source/node_modules/@angular-devkit/schematics/tools/index.js - /home/rsalgado/proyects/bmproyect/source/node_modules/@angular/cli/utilities/json-schema.js - /home/rsalgado/proyects/bmproyect/source/node_modules/@angular/cli/models/command-runner.js - /home/rsalgado/proyects/bmproyect/source/node_modules/@angular/cli/lib/cli/index.js - /home/rsalgado/proyects/bmproyect/source/node_modules/@angular/cli/lib/init.js - /home/rsalgado/proyects/bmproyect/source/node_modules/@angular/cli/bin/ng at Function.Module._resolveFilename (internal/modules/cjs/loader.js:793:17) at Function.Module._load (internal/modules/cjs/loader.js:686:27) at Module.require (internal/modules/cjs/loader.js:848:19) at require (internal/modules/cjs/helpers.js:74:18) at Object.sassLoader (/home/rsalgado/proyects/bmproyect/source/node_modules/@angular-devkit/build-angular/node_modules/sass-loader/lib/loader.js:46:72) ERROR in ./node_modules/@fortawesome/fontawesome-free/scss/fontawesome.scss (./node_modules/@angular-devkit/build-angular/src/angular-cli-files/plugins/raw-css-loader.js!./node_modules/postcss-loader/src??embedded!./node_modules/@angular-devkit/build-angular/node_modules/sass-loader/lib/loader.js??ref--14-3!./node_modules/@fortawesome/fontawesome-free/scss/fontawesome.scss) Module build failed (from ./node_modules/@angular-devkit/build-angular/node_modules/sass-loader/lib/loader.js): Error: Cannot find module 'node-sass'


ivargas tesabiz pro commented 3 years ago

solve that error with the "npm install node-sass @ latest" command, but when you have finished compiling and deploying the web page, the web page is not displayed, everything goes blank and seeing the following error in the FireFox console : "TypeError: Object (...) is not a functionng-uikit-pro-standard.js: 10851: 75 MdbTableService ng-uikit-pro-standard.js: 10851 js ng-uikit-pro-standard.js: 10853 Webpack 10 webpack_require ts webpack_require ts webpack_require 0 webpack_require checkDeferredModules webpackJsonpCallback "


Konrad Stępień staff commented 3 years ago

Hi @ivargas tesabiz,

How we can reproduce the problem? Please, describe to me how to get to the problem and we will find a solution.



Please insert min. 20 characters.

FREE CONSULTATION

Hire our experts to build a dedicated project. We'll analyze your business requirements, for free.

Status

Opened

Specification of the issue

  • User: Pro
  • Premium support: No
  • Technology: MDB Angular
  • MDB Version: 7.5.2
  • Device: Browser
  • Browser: FireFox
  • OS: Linux Fedora
  • Provided sample code: No
  • Provided link: No