ERROR in ./src/styles.scss Module build failed: Error: Cannot find module 'node-sass' at Function.Module._resolveFilename (internal/modules/cjs/loader.js:609:15) at Function.Module._load (internal/modules/cjs/loader.js:535:25) at Module.require (internal/modules/cjs/loader.js:663:17) at require (internal/modules/cjs/helpers.js:20:18) at Object.<anonymous> (/Users/miral.k/Documents/Projects/angular-electron/node_modules/sass-loader/lib/loader.js:3:14) at Module._compile (internal/modules/cjs/loader.js:734:30) at Object.Module._extensions..js (internal/modules/cjs/loader.js:745:10) at Module.load (internal/modules/cjs/loader.js:626:32) at tryModuleLoad (internal/modules/cjs/loader.js:566:12) at Function.Module._load (internal/modules/cjs/loader.js:558:3) at Module.require (internal/modules/cjs/loader.js:663:17) at require (internal/modules/cjs/helpers.js:20:18) at loadLoader (/Users/miral.k/Documents/Projects/angular-electron/node_modules/loader-runner/lib/loadLoader.js:13:17) at iteratePitchingLoaders (/Users/miral.k/Documents/Projects/angular-electron/node_modules/loader-runner/lib/LoaderRunner.js:169:2) at iteratePitchingLoaders (/Users/miral.k/Documents/Projects/angular-electron/node_modules/loader-runner/lib/LoaderRunner.js:165:10) at /Users/miral.k/Documents/Projects/angular-electron/node_modules/loader-runner/lib/LoaderRunner.js:173:18 at loadLoader (/Users/miral.k/Documents/Projects/angular-electron/node_modules/loader-runner/lib/loadLoader.js:36:3) at iteratePitchingLoaders (/Users/miral.k/Documents/Projects/angular-electron/node_modules/loader-runner/lib/LoaderRunner.js:169:2) at iteratePitchingLoaders (/Users/miral.k/Documents/Projects/angular-electron/node_modules/loader-runner/lib/LoaderRunner.js:165:10) at /Users/miral.k/Documents/Projects/angular-electron/node_modules/loader-runner/lib/LoaderRunner.js:173:18 at loadLoader (/Users/miral.k/Documents/Projects/angular-electron/node_modules/loader-runner/lib/loadLoader.js:36:3) at iteratePitchingLoaders (/Users/miral.k/Documents/Projects/angular-electron/node_modules/loader-runner/lib/LoaderRunner.js:169:2) @ multi ./src/styles.scss
This can be resolved by running the following command:
Following the steps, while trying to run the code into my local machine, results in error while building it.
git clone https://github.com/AngularFirebase/angular-electron.git
cd angular-electron/
npm install
npm run electron-build
The last step gives an error:
ERROR in ./src/styles.scss Module build failed: Error: Cannot find module 'node-sass' at Function.Module._resolveFilename (internal/modules/cjs/loader.js:609:15) at Function.Module._load (internal/modules/cjs/loader.js:535:25) at Module.require (internal/modules/cjs/loader.js:663:17) at require (internal/modules/cjs/helpers.js:20:18) at Object.<anonymous> (/Users/miral.k/Documents/Projects/angular-electron/node_modules/sass-loader/lib/loader.js:3:14) at Module._compile (internal/modules/cjs/loader.js:734:30) at Object.Module._extensions..js (internal/modules/cjs/loader.js:745:10) at Module.load (internal/modules/cjs/loader.js:626:32) at tryModuleLoad (internal/modules/cjs/loader.js:566:12) at Function.Module._load (internal/modules/cjs/loader.js:558:3) at Module.require (internal/modules/cjs/loader.js:663:17) at require (internal/modules/cjs/helpers.js:20:18) at loadLoader (/Users/miral.k/Documents/Projects/angular-electron/node_modules/loader-runner/lib/loadLoader.js:13:17) at iteratePitchingLoaders (/Users/miral.k/Documents/Projects/angular-electron/node_modules/loader-runner/lib/LoaderRunner.js:169:2) at iteratePitchingLoaders (/Users/miral.k/Documents/Projects/angular-electron/node_modules/loader-runner/lib/LoaderRunner.js:165:10) at /Users/miral.k/Documents/Projects/angular-electron/node_modules/loader-runner/lib/LoaderRunner.js:173:18 at loadLoader (/Users/miral.k/Documents/Projects/angular-electron/node_modules/loader-runner/lib/loadLoader.js:36:3) at iteratePitchingLoaders (/Users/miral.k/Documents/Projects/angular-electron/node_modules/loader-runner/lib/LoaderRunner.js:169:2) at iteratePitchingLoaders (/Users/miral.k/Documents/Projects/angular-electron/node_modules/loader-runner/lib/LoaderRunner.js:165:10) at /Users/miral.k/Documents/Projects/angular-electron/node_modules/loader-runner/lib/LoaderRunner.js:173:18 at loadLoader (/Users/miral.k/Documents/Projects/angular-electron/node_modules/loader-runner/lib/loadLoader.js:36:3) at iteratePitchingLoaders (/Users/miral.k/Documents/Projects/angular-electron/node_modules/loader-runner/lib/LoaderRunner.js:169:2) @ multi ./src/styles.scss
sudo npm install --save-dev --unsafe-perm node-sass
and then trying to build it again with
npm run electron-build
will work fine.