使用Laravel-mix无法运行npm

时间:2017-09-22 05:49:42

标签: laravel laravel-5 webpack bourbon laravel-mix

我有一些问题,它杀了我。请帮忙。 我试图在DEV中使用命令运行npm:npm run dev

在我的webconfig.mix.js中:mix.sass('resources/assets/sass/style.scss', 'public/css');

This is errors that i got

 95% emitting

 ERROR  Failed to compile with 4 errors                                                                                                                                                                                               05:33:52

This dependency was not found:

* -!../../../node_modules/css-loader/index.js?{"url":true,"sourceMap":false,"importLoaders":1}!../../../node_modules/postcss-loader/lib/index.js??postcss!bootstrap/dist/bootstrap.css in ./node_modules/css-loader?{"url":true,"sourceMap":false,"importLoaders":1}!./node_modules/postcss-loader/lib?{"sourceMap":true,"ident":"postcss","plugins":[null]}!./node_modules/resolve-url-loader?{"sourceMap":true,"root":"/home/vagrant/Code/pudatalk/node_modules"}!./node_modules/sass-loader/lib/loader.js?{"precision":8,"outputStyle":"expanded","sourceMap":true}!./resources/assets/sass/style.scss

To install it, you can run: npm install --save -!../../../node_modules/css-loader/index.js?{"url":true,"sourceMap":false,"importLoaders":1}!../../../node_modules/postcss-loader/lib/index.js??postcss!bootstrap/dist/bootstrap.css

请参阅上面的错误。

所以,当我导入时,我发现它正在发生:

@import "~bourbon/app/assets/stylesheets/_bourbon.scss";

我实现了类似的东西:

.error-bg-img {
    background:url("../img/errorbg.jpg");
    background-size:cover;
}

我想告诉你我在代码中发生了什么问题。

我一直在尝试谷歌它,重新安装这么多东西,移动东西但无望。我是sass,webpack和laravel-mix的新手。

非常感谢

2 个答案:

答案 0 :(得分:1)

好吧,伙计们,

我解决了这个问题,我现在还没有将webpack自动将/ img文件夹中的图像复制到/ public。所以我将/ img从public /文件夹移动到/ resources / assests /。现在一切都很好。

关于这条道路。对不起,我对webpack很新,​​并不知道。

答案 1 :(得分:0)

@import "bourbon/bourbon";

请在此处查看安装指南:https://github.com/thoughtbot/bourbon#requirements