Meteor 应用程序未推送到 Heroku 错误

Meteor application not pushing to Heroku error

我构建了一个使用 bourbon scss 库的 Meteor 应用程序。我试图将我的应用程序推送到 heroku 时出现以下错误:

    Errors prevented bundling:
    While building the application:
    client/styles/bullets.scss: Scss compiler error: undefined
    /tmp/build_52129b38b75a2e6238de86ec866d89cf/mauvsa-gala-9a1eb00877caedf4b5202f30825b1627fb75f874/client/styles/bullets.scss:1:
    file to import not found or unreadable: "bourbon/bourbon"
    Current dir:
    /tmp/build_52129b38b75a2e6238de86ec866d89cf/mauvsa-gala-9a1eb00877caedf4b5202f30825b1627fb75f874/client/styles/
    client/styles/comments.scss: Scss compiler error: undefined
    /tmp/build_52129b38b75a2e6238de86ec866d89cf/mauvsa-gala-9a1eb00877caedf4b5202f30825b1627fb75f874/client/styles/main.scss:1:
    file to import not found or unreadable: "bourbon/bourbon"
    Current dir:
    /tmp/build_52129b38b75a2e6238de86ec866d89cf/mauvsa-gala-9a1eb00877caedf4b5202f30825b1627fb75f874/client/styles/
    client/styles/hero.scss: Scss compiler error: undefined
    /tmp/build_52129b38b75a2e6238de86ec866d89cf/mauvsa-gala-9a1eb00877caedf4b5202f30825b1627fb75f874/client/styles/hero.scss:1:
    file to import not found or unreadable: "bourbon/bourbon"
    Current dir:
    /tmp/build_52129b38b75a2e6238de86ec866d89cf/mauvsa-gala-9a1eb00877caedf4b5202f30825b1627fb75f874/client/styles/
    client/styles/home.scss: Scss compiler error: undefined
    /tmp/build_52129b38b75a2e6238de86ec866d89cf/mauvsa-gala-9a1eb00877caedf4b5202f30825b1627fb75f874/client/styles/home.scss:1:
    file to import not found or unreadable: "bourbon/bourbon"
    Current dir:
    /tmp/build_52129b38b75a2e6238de86ec866d89cf/mauvsa-gala-9a1eb00877caedf4b5202f30825b1627fb75f874/client/styles/
    client/styles/hover.scss: Scss compiler error: undefined
    /tmp/build_52129b38b75a2e6238de86ec866d89cf/mauvsa-gala-9a1eb00877caedf4b5202f30825b1627fb75f874/client/styles/main.scss:1:
    file to import not found or unreadable: "bourbon/bourbon"
    Current dir:
    /tmp/build_52129b38b75a2e6238de86ec866d89cf/mauvsa-gala-9a1eb00877caedf4b5202f30825b1627fb75f874/client/styles/
    client/styles/navigation.scss: Scss compiler error: undefined
    /tmp/build_52129b38b75a2e6238de86ec866d89cf/mauvsa-gala-9a1eb00877caedf4b5202f30825b1627fb75f874/client/styles/main.scss:1:
    file to import not found or unreadable: "bourbon/bourbon"
    Current dir:
    /tmp/build_52129b38b75a2e6238de86ec866d89cf/mauvsa-gala-9a1eb00877caedf4b5202f30825b1627fb75f874/client/styles/
    client/styles/registration.scss: Scss compiler error: undefined
    /tmp/build_52129b38b75a2e6238de86ec866d89cf/mauvsa-gala-9a1eb00877caedf4b5202f30825b1627fb75f874/client/styles/registration.scss:1:
    file to import not found or unreadable: "bourbon/bourbon"
    Current dir:
    /tmp/build_52129b38b75a2e6238de86ec866d89cf/mauvsa-gala-9a1eb00877caedf4b5202f30825b1627fb75f874/client/styles/
    client/styles/main.scss: Scss compiler error: undefined
    /tmp/build_52129b38b75a2e6238de86ec866d89cf/mauvsa-gala-9a1eb00877caedf4b5202f30825b1627fb75f874/client/styles/main.scss:1:
    file to import not found or unreadable: "bourbon/bourbon"
    Current dir:
    /tmp/build_52129b38b75a2e6238de86ec866d89cf/mauvsa-gala-9a1eb00877caedf4b5202f30825b1627fb75f874/client/styles/
     !     Push rejected, failed to compile Node.js app

显然,它找不到 scss 文件,尽管它们在我的 client/styles 文件夹中。有人可以帮忙吗?

我遇到了同样的问题,最后删除了 meteor-bourbon、meteor-neat 和 meteor-bitters 包,而是通过 bower 添加它们。

添加这个 bower meteor 包:mquandalle:bower

Bower init 获取您的 bower.json (我只是将其放在目录的根目录中)并添加您的 bourbon/neat/bitters 依赖项。不要 bower 安装它们,因为 meteor 会自动安装它们。如果这样做,只需删除 bower_components 文件夹。

我的底bower.json:

"dependencies": { "bourbon": "4.2.1", "neat": "1.7.2", "bitters": "1.0.0" }

然后从 /.meteor/local/ 中的位置导入文件。例如,在我的 main.scss 中,我有:

@import "./.meteor/local/bower/bourbon/app/assets/stylesheets/bourbon"; @import "./.meteor/local/bower/neat/app/assets/stylesheets/neat"; @import "./.meteor/local/bower/bitters/app/assets/stylesheets/base";

然后我就可以成功推送到heroku了...希望对你也有用!