After upgrading npm package of Angular app, sass-loader does not work anymore

We Are Going To Discuss About After upgrading npm package of Angular app, sass-loader does not work anymore. So lets Start this Angular Article.

After upgrading npm package of Angular app, sass-loader does not work anymore

How to solve After upgrading npm package of Angular app, sass-loader does not work anymore

It was because of a cached version of node-sass.You can try this.
Remove the node-sass from global npm-cache(For Windows users
%userprofile%\AppData\Roaming\npm-cache).
Remove node-sass from your project’s node_modules dir.
Do npm install to reinstall node-sass.

After upgrading npm package of Angular app, sass-loader does not work anymore

It was because of a cached version of node-sass.You can try this.
Remove the node-sass from global npm-cache(For Windows users
%userprofile%\AppData\Roaming\npm-cache).
Remove node-sass from your project’s node_modules dir.
Do npm install to reinstall node-sass.

Solution 1

It was because of a cached version of node-sass.You can try this.

  • Remove the node-sass from global npm-cache(For Windows users
    %userprofile%\AppData\Roaming\npm-cache).
  • Remove node-sass from your project’s node_modules dir.
  • Do npm install to reinstall node-sass.

Original Author Sakthi Bala K.S Of This Content

Solution 2

I had to put a ~ sign in front the path.
That resolved it:

@import ‘~my-custom-package-layout/src/lib/styles/mixins.scss’;

Original Author Sakthi Bala K.S Of This Content

Solution 3

I’ve tried to add ~ before the library name, and in the angular.json I tried to add the library to stylePreprocessorOptions.includePaths but it isn’t working for me.

I added node_modules before the library name and it solve my problem.
@import 'node_modules/@myscope/mylib/src/assets/input.base.scss';

Original Author Nadav Avisror Of This Content

Conclusion

So This is all About This Tutorial. Hope This Tutorial Helped You. Thank You.

Also Read,

ittutorial team

I am an Information Technology Engineer. I have Completed my MCA And I have 4 Year Plus Experience, I am a web developer with knowledge of multiple back-end platforms Like PHP, Node.js, Python and frontend JavaScript frameworks Like Angular, React, and Vue.

Leave a Comment