Errors installing node-sass in Angular 6 project


I’ve cloned a repo from an existing Angular 6 project and executed npm install. After a bunch of warnings about deprecated packages (not unexpected, given that the project was created several years ago using Angular 6), I get a bunch of errors:

npm ERR! code 1
npm ERR! path /Users/.../node_modules/ng-packagr/node_modules/node-sass
npm ERR! command failed
npm ERR! command sh /var/folders/xx/41k1bd6j11j5zh2vl572rg0m0000gn/T/
npm ERR! Building: /usr/local/bin/node /Users/.../node_modules/ng-packagr/node_modules/node-gyp/bin/node-gyp.js rebuild --verbose --libsass_ext= --libsass_cflags= --libsass_ldflags= --libsass_library=
npm ERR!


Notably, node-sass is not listed in package.json as a dependency.

My version of npm is 8.15.0 and node is v16.17.0.

For what it’s worth – I have python 2.7.18 installed.

I’ve read here that node-sass has been deprecated, and I should replace it with sass, however, since it’s not listed in package.json, I don’t know how to do that.

Thanks for your help!


For Angular 6 using node v16 might be causing the problem. Please refer this table for Angular CLI ~ Angular ~ Node computability versions

Angular Compatibility Matrix

So according to this your local versions should be

  • Angular Cli – 6.0.8
  • Node – 8.9.4

Answered By – HariHaran

This Answer collected from stackoverflow, is licensed under cc by-sa 2.5 , cc by-sa 3.0 and cc by-sa 4.0

Leave a Reply

(*) Required, Your email will not be published