1
votes

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

2

2 Answers

1
votes

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
0
votes

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.