npm install - 在 spawn sass.bat ENOENT 中出现错误

npm install - getting error in spawn sass.bat ENOENT

我需要帮助,我是构建 React 网站的新手 - 当我 运行 来自我的 package.json 文件(npm 运行 包)的脚本时 - 踢关闭脚本: npm install --no-optional && webpack --config config/webpack.dev.config.js

一段时间后,它像构建一样运行,我收到此错误

app.{hash#}.js 文件已编译,但我的应用程序不会 运行

我收到这个错误

ERROR in ./~/css-loader!./~/ruby-sass-loader!./~/style-loader!./~/css-loader!./src/scss/app.scss
Module build failed: Error: spawn sass.bat ENOENT
   at Process.ChildProcess._handle.onexit (internal/child_process.js:268:19)
   at onErrorNT (internal/child_process.js:468:16)
   at processTicksAndRejections (internal/process/task_queues.js:84:21)
@ ./src/scss/app.scss 4:14-201
@ ./src/app.tsx
@ multi babel-polyfill ./src/app.tsx
Child html-webpack-plugin for "..\index.html":
      [0] ./~/lodash/lodash.js 540 kB {0} [built]
      [1] ./~/html-webpack-plugin/lib/loader.js!./framework/index.html 4.9 kB {0} [built]
      [2] (webpack)/buildin/global.js 509 bytes {0} [built]
      [3] (webpack)/buildin/module.js 517 bytes {0} [built]
Child html-webpack-plugin for "C:\Views\Home\Index.cshtml":
      [0] ./~/lodash/lodash.js 540 kB {0} [built]
      [1] ./~/html-webpack-plugin/lib/loader.js!./framework/index.html 4.9 kB {0} [built]
      [2] (webpack)/buildin/global.js 509 bytes {0} [built]
      [3] (webpack)/buildin/module.js 517 bytes {0} [built]
npm ERR! code ELIFECYCLE
npm ERR! errno 2
npm ERR! project@0.0.0 pack: npm install --no-optional && webpack --config config/webpack.dev.config.js
npm ERR! Exit status 2
npm ERR!
npm ERR! Failed at the project@0.0.0 pack script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
npm ERR! A complete log of this run can be found in:
npm ER

谢谢!

问题已解决:我能够为 Windows 下载并安装 https://rubyinstaller.org/downloads/ Ruby 开发工具包,然后 运行 命令 gem install sass 这解决了我的问题Visual Studio 代码中的构建问题 - 感谢大家为这个奇怪的设置问题提供帮助!