6

I am working with angular and node, when i run the command npm start i get this error

ERROR in ./src/styles.scss (./node_modules/css-loader/dist/cjs.js??ref--13-1!./node_modules/postcss-loader/src??embedded!./node_modules/sass-loader/dist/cjs.js??ref--13-3!./src/styles.scss) Module build failed (from ./node_modules/postcss-loader/src/index.js): Error: ENOENT: no such file or directory, open '...\node_modules@angular\material\prebuilt-themes\indigo-pink.css' at Object.openSync (fs.js:457:3) at Object.readFileSync (fs.js:359:35) at Storage.provideSync (...\node_modules\enhanced-resolve\lib\CachedInputFileSystem.js:109:13) at CachedInputFileSystem.readFileSync (...\node_modules\enhanced-resolve\lib\CachedInputFileSystem.js:289:32) at Observable._subscribe (...\node_modules@ngtools\webpack\src\webpack-input-host.js:35:51)

I have tried view some similar post but no solution work. My node.js version is

v12.16.1

My angular version is

Angular CLI: 9.1.9 Node: 12.16.1 OS: win32 x64

3 Answers 3

4

If you are using angular and if following is not working.

@import "../node_modules/ag-grid-community/dist/styles/ag-grid.css";
@import "../node_modules/ag-grid-community/dist/styles/ag-theme-alpine.css";

then try the following inside styles array in angular.json file

"styles": [ "src/styles.scss", "node_modules/ag-grid-community/dist/styles/ag-grid.css", "node_modules/ag-grid-community/dist/styles/ag-theme-alpine.css", ]

It is a working example.

Sign up to request clarification or add additional context in comments.

Comments

3

I recommend to use node 10 as it more suitable for angular 9. You can easily do that using nvm.

Then you can try below steps,

  • rm -rf node_modules
  • npm i --save-exact
  • ng s

Comments

1

The issue is that the postcss with the CSS module is not configured or installed. I resolved the issue by installing this package:

npm install babel-plugin-react-css-modules --save

You can readmore about resolving the issue here: https://dev.to/daveirvine/postcss-with-css-modules-andreact-51ln

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.