【问题标题】:Angular 7.1 project unable to compileAngular 7.1 项目无法编译
【发布时间】:2022-01-30 02:21:41
【问题描述】:

前段时间,我使用 Angular 7.1.4 版本制作了一个 Angular 项目。我让它处于完美的工作状态。没有任何错误...但是现在经过一段时间后我回到了那个项目并运行了ng serve -o 命令,现在我收到了这个错误:

ERROR in ./src/styles.scss (./node_modules/@angular-devkit/build-angular/src/angular-cli-files/plugins/raw-css-loader.js!./node_modules/postcss-loader/src??embedded!./node_modules/sass-loader/lib/loader.js??ref--14-3!./src/styles.scss)
Module build failed (from ./node_modules/sass-loader/lib/loader.js):                                                                                                                                                                       
Error: Node Sass does not yet support your current environment: Windows 64-bit with Unsupported runtime (93)
For more information on which environments are supported please see:
https://github.com/sass/node-sass/releases/tag/v4.14.1

如果我正确理解错误但我不确定现在该怎么做,我发现它与不推荐使用 node-sass 依赖项有关...任何帮助将不胜感激...如果我没有提供足够的帮助信息请告诉我:)

【问题讨论】:

  • 尝试删除你的 node_modules 文件夹并执行干净的 npm 安装
  • @SecurityObscurity 抱歉,但这并不能解决我的问题...删除节点模块文件夹并运行 npm install 后,我再次遇到同样的错误
  • 尝试 npm uninstall node-sass && npm install node-sass

标签: angular npm node-modules node-sass


【解决方案1】:

查看 Angular 7 对 node 和 npm https://gist.github.com/LayZeeDK/c822cc812f75bb07b7c55d07ba2719b3 要求的兼容性方案 如果您在上次处理此问题后更新了其中任何一个,则可能是问题所在。 降级到所需版本,然后再次执行 npm install

【讨论】:

  • 正如目前所写,您的答案尚不清楚。请edit 添加其他详细信息,以帮助其他人了解这如何解决所提出的问题。你可以找到更多关于如何写好答案的信息in the help center
猜你喜欢
  • 1970-01-01
  • 2022-09-25
  • 2012-11-08
  • 2011-10-22
  • 2022-01-15
  • 2020-12-04
  • 2013-12-05
  • 1970-01-01
  • 1970-01-01
相关资源
最近更新 更多