'Can't build project made with Angular CLI and SCSS
- Created a new project with Angular CLI
- Selected SCSS
- Runs well on localhost with ng serve
- Can't run build, it throws an error, only with SCSS.
Angular CLI version:
Angular CLI: 13.0.2
Node: 14.18.2
Package Manager: npm 6.14.15
OS: linux x64
Angular:
...
Package Version
------------------------------------------------------
@angular-devkit/architect 0.1300.2 (cli-only)
@angular-devkit/core 13.0.2 (cli-only)
@angular-devkit/schematics 13.0.2 (cli-only)
@schematics/angular 13.0.2 (cli-only)
Here is the error log:
Solution 1:[1]
Step 1: $ npm cache clean --force
Step 2: Delete node_modules by $ rm -rf node_modules
(rmdir /S /Q node_modules
in windows) folder or delete it manually by going into the directory and right-click > delete / move to trash. If are not updating your packages you can delete the package-lock.json
file too.
Step 3: npm install
To start again,
$ npm start
This worked for me. Hopes it works for you too.
PS: Still if it is there, kindly check the error it is displaying in read and act accordingly. This error is specific to node.js environment.
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 | Shruti Jain |