Angular bootstrap Can’t find stylesheet to import.

Error while running ng build command:

./src/styles.scss - Error: Module build failed (from ./node_modules/sass-loader/dist/cjs.js):
SassError: Can't find stylesheet to import.
@import "~bootstrap/scss/bootstrap";

Go to your styles files i.e src/styles.scss

Replace the following line:

@import "~bootstrap/scss/bootstrap";

with this:

@import "bootstrap/scss/bootstrap";

i.e remove the tild (~) from the path.

Running ng build again will not face that issue now.