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/xxxxponent.ts Module not found: Error: Can't resolve './xxxxxponent.scss' in 'C:\Users\oooo\mmmm\App\zzzz\src\app\yyyy\xxxx'.
I tried installing node-sass with below mands but nothing's working. I am also getting the python error when I try to run below mands.
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.
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.ponent.ts Module not found: Error: Can't resolve './xxxxx.ponent.scss' in 'C:\Users\oooo\mmmm\App\zzzz\src\app\yyyy\xxxx'.
I tried installing node-sass with below mands but nothing's working. I am also getting the python error when I try to run below mands.
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.
Share Improve this question edited Apr 5, 2019 at 11:10 Bhagya Swamy asked Apr 5, 2019 at 11:02 Bhagya SwamyBhagya Swamy 951 gold badge3 silver badges12 bronze badges 13- 1 Have you tried removing node_modules and re-run npm install? – Sebastian Kaczmarek Commented Apr 5, 2019 at 11:05
- @SebastianKaczmarek Yes I did and it didn't work – Bhagya Swamy Commented Apr 5, 2019 at 11:06
-
Hmm, maybe this one:
npm rebuild node-sass --force
? – Sebastian Kaczmarek Commented Apr 5, 2019 at 11:06 - @SebastianKaczmarek just tried and same error :( – Bhagya Swamy 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. – Dimanoid Commented Apr 5, 2019 at 11:52
3 Answers
Reset to default 2I 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 mand
npm install --force
- Check your version of node.js.
- Make sure you uninstall global version of node_sass (if you have installed previously)
- If its < 10 or v. 12 please install node v.10 with lts support.
That should fix your issue.
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./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])