3

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.

asked Apr 5, 2019 at 11:02
13
  • 1
    Have you tried removing node_modules and re-run npm install? Commented Apr 5, 2019 at 11:05
  • @SebastianKaczmarek Yes I did and it didn't work Commented Apr 5, 2019 at 11:06
  • Hmm, maybe this one: npm rebuild node-sass --force? Commented Apr 5, 2019 at 11:06
  • @SebastianKaczmarek just tried and same error :( Commented Apr 5, 2019 at 11:07
  • 1
    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. Commented Apr 5, 2019 at 11:52

3 Answers 3

2

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
Kick Buttowski
6,73713 gold badges39 silver badges61 bronze badges
answered May 24, 2019 at 15:49
Sign up to request clarification or add additional context in comments.

1 Comment

After struggling to fix it for entire day, this post helped me counter this issue. God bless u brother.
0
  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.

answered Jun 24, 2019 at 13:56

Comments

-2

I know its too late to answer this question but I found perfect solution of this issue.

You need to check your node version and according install node-sass https://www.npmjs.com/package/node-sass
Suppose your version is v13.14.0 (in cmd type node -v ) then install 4.13 node-sass version (npm i [email protected])

answered Sep 6, 2023 at 10:28

1 Comment

NOT CLEAR AT ALL.

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

By clicking "Post Your Answer", you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.