【问题标题】:Heroku react app build failed (node-sass)Heroku react 应用程序构建失败(node-sass)
【发布时间】:2021-04-22 09:30:10
【问题描述】:
  • 上一个版本正在运行,并且此版本中只有 UI 更改。
  • 我只更改了我正在使用的设备,所以可能我忘记下载了。
  • 我不知道为什么这不起作用。
  • 无论如何我都没能解决这个问题。

"node-sass": "^5.0.0",

构建日志的第一部分:

-----> Building on the Heroku-20 stack
-----> Using buildpack: mars/create-react-app
-----> React.js (create-react-app) multi app detected
=====> Downloading Buildpack: https://github.com/heroku/heroku-buildpack-multi.git
=====> Detected Framework: Multipack
=====> Downloading Buildpack: https://github.com/heroku/heroku-buildpack-nodejs.git
=====> Detected Framework: Node.js
       
-----> Creating runtime environment
       
       NPM_CONFIG_LOGLEVEL=error
       NODE_VERBOSE=false
       NODE_ENV=production
       NODE_MODULES_CACHE=true
       
-----> Installing binaries
       engines.node (package.json):  >=10
       engines.npm (package.json):   >=6
       
       Resolving node version >=10...
       Downloading and installing node 16.0.0...
       Bootstrapping npm >=6 (replacing 7.10.0)...
       npm >=6 installed
       
-----> Installing dependencies
       Installing node modules
       npm ERR! code 1
       npm ERR! path /tmp/build_a9056f2a/node_modules/node-sass
       npm ERR! command failed
       npm ERR! command sh -c node scripts/build.js
       npm ERR! Building: /tmp/build_a9056f2a/.heroku/node/bin/node /tmp/build_a9056f2a/node_modules/node-gyp/bin/node-gyp.js 

【问题讨论】:

  • 一年前我也遇到过类似的问题,我通过在依赖项而不是 dev 依赖项中安装 node-sass 解决了这个问题。这是/也许是一种解决方法,但它对我有用。

标签: reactjs heroku node-sass


【解决方案1】:

解决方案:

node-sass 的节点版本支持策略: https://www.npmjs.com/package/node-sass

【讨论】:

  • 对,目前不支持 Node 16
猜你喜欢
  • 2021-11-16
  • 2023-03-06
  • 2022-06-14
  • 2019-04-07
  • 2019-03-18
  • 1970-01-01
  • 1970-01-01
  • 2015-05-08
  • 2019-10-28
相关资源
最近更新 更多