'Facing error while running ng serve command
I am trying to run ng serve command for my project , i tried npm i command for many times, but it showing same error continously. Node version is : v16.13.2 Npm version is : 8.4.1
Solution 1:[1]
Your Issue
The error you facing with running the application is issue with the SCSS compilation. Certain packages are missing related scss
Try - npm rebuild node-sass --force
If still doesn't work out, freshly recreate the project and follow standard installation of libraries related to scss.
Helping Link:
- Angular won't run my ng serve - Sass Loader error
- Node Sass does not yet support your current environment: Linux 64-bit with false
Standard Angular Issue Resolution
- Delete
package-lock.json. - Clear cache -
npm cache clean --forceornpm cache clean -f - Delete
node_modulesfolder - Reinstall dependencies -
npm install - Run the application -
ng serve
Solution 2:[2]
Please follow below steps to resolve this issue which worked in my case.
Delete
node-sassfolder (..\AppData\Roaming\npm-cache\node-sass),node-modulesfolder andpackage-lock.jsonClear cache -
npm cache clean --forceReinstall
node-sassglobally -npm i [email protected] --unsafe-perm=true --allow-rootReinstall project dependencies -
npm install -no-package-lockStart application -
ng serveornpm start
This should update your node-sass global version. (please update version that you need to have as per your project)
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|---|
| Solution 1 | Chirag Maniar |
| Solution 2 | Ganesh |
