【发布时间】:2019-11-24 20:57:44
【问题描述】:
我已将我的 React 应用程序部署到 Azure 上,目前在加载网站时出现此编译错误:
./src/components/LoadingScreen/LoadingScreen.scss (./node_modules/css-loader/dist/cjs.js??ref--6-oneOf-5-1!./node_modules/postcss-loader/src??postcss!./node_modules/sass-loader/lib/loader.js??ref--6-oneOf-5-3!./src/components/LoadingScreen/LoadingScreen.scss)
Error: Missing binding /home/site/wwwroot/node_modules/node-sass/vendor/linux-x64-64/binding.node
Node Sass could not find a binding for your current environment: Linux 64-bit with Node.js 10.x
Found bindings for the following environments:
- Windows 64-bit with Node.js 10.x
This usually happens because your environment has changed since running `npm install`.
Run `npm rebuild node-sass` to download the binding for your current environment.
我尝试在几个地方运行npm rebuild node-sass,但到目前为止都没有运气。发生这种情况是因为它是用 Windows 构建但部署到 Linux 机器上的吗?我该如何解决这个问题?
【问题讨论】:
-
删除
node_modules下的node-sass文件夹然后执行npm install -
酷,我把它作为答案,请接受它是正确的
标签: reactjs azure node-modules node-sass