Search code examples
angularsassangular-clinode-sassangular7

Angular CLI SCSS module build failed on windows


I have created a new angular application with the angular cli (ng new my-app --style=scss). Both ng serve and ng build fail if any scss file has any content (even the initial comment in styles.scss fails to compile):

body { display: block; }

Module build failed (from ./node_modules/sass-loader/lib/loader.js): TypeError: Instance of 'dz': type 'dz' is not a subtype of type 'n'

My system:

  • Angular CLI: 7.0.3
  • Node: 8.9.3
  • OS: win32 x64
  • node-sass: 4.10.0
  • sass-loader: 7.1.0
  • npm: 6.4.1

It works on another windows machine.


Solution

  • After uninstalling global sass with npm uninstall -g sass, the build worked.