模块构建失败(来自./node_modules/postcss-loader/src/index.js) [英] Module build failed (from ./node_modules/postcss-loader/src/index.js)

查看:264
本文介绍了模块构建失败(来自./node_modules/postcss-loader/src/index.js)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用角度和节点,当我运行命令 npm start 时,出现此错误

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

./src/styles.scss中的错误(./node_modules/css-loader/dist/cjs.js??ref--13-1!./node_modules/postcss-loader/src ??嵌入!./node_modules/sass-loader/dist/cjs.js ?? ref--13-3!./src/styles.scss)模块构建失败(来自./node_modules/postcss-loader/src/index.js):错误:否:没有此类文件或目录,请打开"... \ node_modules @ angular \ material \ prebuilt-themes \ indigo-pink.css"在Object.openSync(fs.js:457:3)在Object.readFileSync(fs.js:359:35)在Storage.provideSync(... \ node_modules \ enhanced-resolve \ lib \ CachedInputFileSystem.js:109:13)在CachedInputFileSystem.readFileSync(... \ node_modules \ enhanced-resolve \ lib \ CachedInputFileSystem.js:289:32)在Observable._subscribe(... \ node_modules @ ngtools \ webpack \ src \ webpack-input-host.js:35:51)

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)

我尝试查看一些类似的帖子,但是没有解决方案.我的node.js版本是

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

v12.16.1

v12.16.1

我的棱角版本是

Angular CLI:9.1.9节点:12.16.1操作系统:win32 x64

Angular CLI: 9.1.9 Node: 12.16.1 OS: win32 x64

推荐答案

我建议使用节点10,因为它更适合角度9.您可以使用

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-精确保存
  • ng s

这篇关于模块构建失败(来自./node_modules/postcss-loader/src/index.js)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆