Jas*_* FB 10 ruby-on-rails heroku node-sass
红宝石 2.7.4 导轨 6.1.4.1
注意:我的应用程序中缺少package.json密钥engines
Heroku 在构建过程中失败并出现此错误
这个提交是一个空的提交,位于我昨天成功推送的 SHA 之上(我现在已经检查了两次),所以我怀疑这是一个平台问题,或者不知何故,node-sass 昨天被弃用或撤回了?
我怎样才能解决这个问题?
remote:
remote: ERROR in ./app/javascript/require_bootstrap.scss
remote: Module build failed (from ./node_modules/mini-css-extract-plugin/dist/loader.js):
remote: ModuleBuildError: Module build failed (from ./node_modules/sass-loader/dist/cjs.js):
**remote: Error: Node Sass does not yet support your current environment: Linux 64-bit with Unsupported runtime (93)**
remote: For more information on which environments are supported please see:
remote: https://github.com/sass/node-sass/releases/tag/v4.14.1
remote: at module.exports (/tmp/build_1c436dcf/node_modules/node-sass/lib/binding.js:13:13)
remote: at Object.<anonymous> (/tmp/build_1c436dcf/node_modules/node-sass/lib/index.js:14:35)
remote: at Module._compile (/tmp/build_1c436dcf/node_modules/v8-compile-cache/v8-compile-cache.js:192:30)
remote: at Object.Module._extensions..js (node:internal/modules/cjs/loader:1153:10)
Run Code Online (Sandbox Code Playgroud)
tpe*_*ett 39
Heroku 于 2021 年 12 月将 Ruby buildpack 的默认节点从 14 更改为 16。
Heroku 将heroku/rubybuildpack Node 版本从 Node 14 更新到 Node 16(请参阅https://devcenter.heroku.com/changelog-items/2306),这与您可能锁定的 Webpack 版本中的 Node Sass 版本不兼容使用。
要修复它,请执行以下两件事:
package.json。# In package.json
{
# ...
"engines": {
"node": "14.x"
},
# ...
}
Run Code Online (Sandbox Code Playgroud)
heroku/nodejs构建包。您可以在 Web 界面或命令行中执行此操作。以下是 CLI 的命令:heroku/ruby$ heroku buildpacks:add heroku/nodejs -i 1 -a YOUR-APP-NAME
Run Code Online (Sandbox Code Playgroud)
当 NodeJS 构建包首先运行时,它会查看该package.json文件并在选择要安装的 Node 版本时尊重该文件。然后 Ruby 构建包将运行,并且由于 Node 的版本已经存在,因此它将仅使用该版本,并且一切都应该像以前一样工作。
| 归档时间: |
|
| 查看次数: |
5336 次 |
| 最近记录: |