Angular CLI: 7.0.3 Cannot find module 'node-sass'
Bug Report or Feature Request (mark with an x)
- [x] bug report -> please search issues before submitting
- [ ] feature request
Command (mark with an x)
- [ ] new
- [ ] build
- [x] serve
- [ ] test
- [ ] e2e
- [ ] generate
- [ ] add
- [ ] update
- [ ] lint
- [ ] xi18n
- [ ] run
- [ ] config
- [ ] help
- [ ] version
- [ ] doc
Versions
Angular` CLI: 7.0.3
Node: 11.0.0
OS: win32 x64
Angular: 7.0.1
... animations, cdk, common, compiler, compiler-cli, core, forms
... http, language-service, material, platform-browser
... platform-browser-dynamic, router, service-worker
Package Version
-----------------------------------------------------------
@angular-devkit/architect 0.10.3
@angular-devkit/build-angular 0.10.3
@angular-devkit/build-optimizer 0.10.3
@angular-devkit/build-webpack 0.10.3
@angular-devkit/core 7.0.3
@angular-devkit/schematics 7.0.3
@angular/cli 7.0.3
@angular/flex-layout 7.0.0-beta.19
@angular/pwa 0.10.3
@ngtools/webpack 7.0.3
@schematics/angular 7.0.3
@schematics/update 0.10.3
rxjs 6.3.3
typescript 3.1.3
webpack 4.19.1
Repro steps
ng new prova
? Would you like to add Angular routing? No
? Which stylesheet format would you like to use? SCSS [ http://sass-lang.com ]
ng serve
The log given by the failure
** Angular Live Development Server is listening on localhost:4200, open your browser on http://localhost:4200/ **
Date: 2018-10-25T09:17:54.974Z
Hash: 98b297ee437ab1226eb2
Time: 9888ms
chunk {main} main.js, main.js.map (main) 10.9 kB [initial] [rendered]
chunk {polyfills} polyfills.js, polyfills.js.map (polyfills) 228 kB [initial] [rendered]
chunk {runtime} runtime.js, runtime.js.map (runtime) 6.22 kB [entry] [rendered]
chunk {styles} styles.js, styles.js.map (styles) 17 kB [initial] [rendered]
chunk {vendor} vendor.js, vendor.js.map (vendor) 3.46 MB [initial] [rendered]
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:587:15)
at Function.Module._load (internal/modules/cjs/loader.js:513:25)
at Module.require (internal/modules/cjs/loader.js:643:17)
at require (internal/modules/cjs/helpers.js:22:18)
at Object.sassLoader (C:\Users\Giacomo\Documents\Visual Studio 2017\Projects\Angular\prova\node_modules\sass-loader\lib\loader.js:46:72)
i 「wdm」: Failed to compile.
Desired functionality
Compile well
Mention any other details that might be useful
After update NodeJs and latest Angular CLI compile stop to work. I try also to delete all node_module folder and install again the package without solve.
npm install node-sass
https://stackoverflow.com/questions/48147896/error-in-cannot-find-module-node-sass
@alaminfirdows : The easiest solution is probably just downgrading to node 10 (
nvm i 10.13.0). There is another issue with building gprc with node 11, so it's not the most stable right now (grpc/grpc-node#594).If you insist on using node 11, you can try your luck with rebuilding node sass, after your install (
npm rebuild node-sass). If that works, you should be good to go - if it fails you need to fix the build from source until node-sass releases binary packages.
downgrading to node 10 helped me to resolve this issue. Thanks a lot :)
My problem is solved with npm install --save-dev node-sass
This issue has been automatically locked due to inactivity. Please file a new issue if you are encountering a similar or related problem.
Read more about our automatic conversation locking policy.
This action has been performed automatically by a bot.