3
votes

I am trying to run my application but I am getting the below error.

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/sass-loader/lib/loader.js??ref--14-3!./src/styles.scss) Module build failed (from ./node_modules/sass-loader/lib/loader.js): Error: Cannot find module 'node-sass' at Function.Module._resolveFilename (internal/modules/cjs/loader.js:581:15) at Function.Module._load (internal/modules/cjs/loader.js:507:25) at Module.require (internal/modules/cjs/loader.js:637:17) at require (internal/modules/cjs/helpers.js:22:18) at Object.sassLoader (C:\Users\xxx\xxx\App\xxxx\node_modules\sass-loader\lib\loader.js:46:72) ERROR in ./src/app/widget-modules/xxxxx/xxxx.component.ts Module not found: Error: Can't resolve './xxxxx.component.scss' in 'C:\Users\oooo\mmmm\App\zzzz\src\app\yyyy\xxxx'.

I tried installing node-sass with below commands but nothing's working. I am also getting the python error when I try to run below commands.

    npm i node-sass
    npm i --save node-sass
    npm i --save-dev node-sass
    npm install --save-dev  --unsafe-perm node-sass

Error:

can't find python executable python you can set the python env variable.

Also I deleted the node_modules folder and reinstalled but not working.

2
Have you tried removing node_modules and re-run npm install?Sebastian Kaczmarek
@SebastianKaczmarek Yes I did and it didn't workBhagya Swamy
Hmm, maybe this one: npm rebuild node-sass --force?Sebastian Kaczmarek
@SebastianKaczmarek just tried and same error :(Bhagya Swamy
Probably, windows-build-tools installs globally so you may need enough access right for that. Try to search how to configure node/npm to use separate folder for global packages.Dimanoid

2 Answers

1
votes

I know this is late answer, but it may be help for some one in future

The same problem ,I faced.In my case, I installed npm by using force with below command

npm install --force
0
votes
  1. Check your version of node.js.
  2. Make sure you uninstall global version of node_sass (if you have installed previously)
  3. If its < 10 or v. 12 please install node v.10 with lts support.

That should fix your issue.