错误:找不到模块:错误:无法解析 src/app/app.component.css?ngResource Angular

D3a*_*HpR 5 compiler-errors node.js node-modules angular

我面临这三个问题,我仍然不明白你的错误在哪里。

\n

错误:找不到模块:错误:无法解析“C:\\Users\\DexSh\”中的“C:/Users/DexSh/desktop/C# Angular/Testing/src/app/app.component.css?ngResource” \desktop\\C# Angular\\Testing'

\n

错误:找不到模块:错误:无法解析 'C:\\Users\\DexSh\\desktop\\C# Angular\\Testing\\node_modules\\webpack-dev-server\\client\\index.js?协议=auto%3A&用户名=&密码=&主机名=0.0.0.0&端口=0&路径名=%2Fng-cli-ws&logging=信息&覆盖=%7B%22errors%22%3Atrue%2C%22warnings%22%3Afalse%7D&reconnect=10&hot=false&live-reload =true' in 'C:\\Users\\DexSh\\desktop\\C# Angular\\Testing'

\n

错误:加载程序“C:/Users/DexSh/desktop/C# Angular/Testing/src/app/app.component.css”未返回字符串。

\n

当使用 ng build 返回这个

\n
\nWarning: \xe2\x96\xb2 [WARNING] Comments in CSS use "/* ... */" instead of "//" [js-comment-in-css]\n\n    C:/Users/DexSh/desktop/C# Angular/Testing/src/app/app.component.css:1:18:\n      1 \xe2\x94\x82 /******/ (() => { // webpackBootstrap\n        \xe2\x95\xb5                   ~~\n\n\n\nWarning: \xe2\x96\xb2 [WARNING] Unexpected "(" [css-syntax-error]\n\n    C:/Users/DexSh/desktop/C# Angular/Testing/src/app/app.component.css:1:9:\n      1 \xe2\x94\x82 /******/ (() => { // webpackBootstrap\n        \xe2\x95\xb5          ^\n\n\n\n\n\nError: Module not found: Error: Can't resolve 'C:/Users/DexSh/desktop/C# Angular/Testing/src/app/app.component.css?ngResource' in 'C:\\Users\\DexSh\\desktop\\C# Angular\\Testing'\n\nError: The loader "C:/Users/DexSh/desktop/C# Angular/Testing/src/app/app.component.css" didn't return a string.\n
Run Code Online (Sandbox Code Playgroud)\n

谁能告诉我是什么原因造成的,每个项目都有这个问题

\n

等待正常构建和项目执行

\n

Ben*_*tin 4

问题是您的文件夹名称中有一个 # -> (C# Angular)。这个f。问题也让我狂暴起来......