INDRAJITH EKANAYAKE
INDRAJITH EKANAYAKE

Reputation: 4274

Angular: File to import not found or unreadable: ~css-star-rating/scss/star-rating

I'm trying to set up a project which is using Angular 6 in frontend. When I'm run the project using ng serve command there is an error as follows,

ERROR in ./src/styles.scss (./node_modules/raw-loader!./node_modules/postcss-loader/lib??embedded!./node_modules/sass-loader/dist/cjs.js??ref--14-3!./src/styles.scss) Module build failed: @import '~css-star-rating/scss/star-rating'; ^ File to import not found or unreadable: ~css-star-rating/scss/star-rating. in D:\trackitRevamp\trackit3\src\main\Trackit-Revamp\src\styles.scss (line 10, column 1)

As the error says itself the error is in line 10 in styles.scss file,

@import '~css-star-rating/scss/star-rating';

Above is my line 10. What I want to know is how to resolve this error by installing this node module package?

But in my package.json I already have below node packages,

"angular-star-rating": "^4.0.0-beta.3",
    "css-star-rating": "^1.2.4",

Upvotes: 1

Views: 1164

Answers (1)

INDRAJITH EKANAYAKE
INDRAJITH EKANAYAKE

Reputation: 4274

Finally, I found the cause of the problem and hope this will helpfull for someone in the future, So what the actual cause is the version of "angular-star-rating" which I'm currently having is a mismatch with the version project expect. So I have to reinstall that or simply run following command to upgrade or downgrade version.

$ npm install css-star-rating

After running below command I can simply run ng serve to run the project and it will work.

Upvotes: 1

Related Questions