【发布时间】:2021-08-07 19:53:07
【问题描述】:
我用 npm create-react-app 制作了一个使用 NodeJS 后端的 React 应用程序。我正在尝试通过 Visual Studio Code 扩展在 Azure 上进行部署。
我没有在本地构建,而是将脚本放在 package.json(根文件夹)中的脚本对象中
"build": "cd client && npm install && npm run build"
我的 server.js 像这样解析到 react 应用的路由:
app.use(express.static("client/build"));
app.get("*", (req, res) => {
res.sendFile(path.resolve(__dirname, "client", "build", "index.html"));
});
在我配置应用服务、资源计划等并部署到应用服务中的应用后,我得到
Node Sass could not find a binding for your current environment: Linux 64-bit with Node.js 12.x
Found bindings for the following environments:
Windows 64-bit with Node.js 12.x
我在应用服务中的 Files 文件夹是空的(只有 hostingstart.html)
我尝试删除 node-sass 并重新安装它,我尝试重建它但没有任何帮助。
【问题讨论】:
标签: node.js reactjs azure node-sass