Laravel Elixir 6在“吞噬手表”上获得例外 [英] Laravel Elixir 6 getting exception on "gulp watch"

查看:191
本文介绍了Laravel Elixir 6在“吞噬手表”上获得例外的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

当我尝试运行 gulp watch 时,出现此错误:

  stream.js:74 
throw er; //管道中未处理的流错误。
^

错误:ENOENT:没有这样的文件或目录,stat'XXXX\public\build\css\client-18724fe72d.css'
at Error(本地)

我试图离开 client.scss 文件为空,并且错误消失。当我在 client.scss 中有这些行时,我发现错误有时会出现:

  //页面
@import'pages / client / auth';
@import'pages / client / normals';
@import'pages / client / orders';

我已经检查了它们中的每一个,并且语法或其他类似的东西没有错。甚至更多的是,当我运行 gulp 时,它没有任何错误。



这是我的gulpfile.js:

  const elixir = require('laravel-elixir'); 

elixir(mix => {
mix
.sass('app.scss')
.sass('client.scss','public / css /client.css')
.sass('panel.scss','public / css / panel.css')
.copy('resources / assets / fonts','public / build / fonts' ')
.copy('resources / assets / images','public / build / images')
.webpack('app.js')
.webpack('panel.js' )
.version(['css / app.css','css / client.css','css / panel.css','js / app.js','js / panel.js'])
});

这是文件结构:



有什么我在这里做错了吗?

解决方案

把我的两分钱扔在这里。我遇到了同样的问题,只要我停止使用开始/相对路径选项,并且使用了完整的相对路径(相对于/ resources),它就会消失。



所以,而不是:

  mix.styles([$ b $'vendor / jquery-steps / demo / css / jquery。 steps.css',
'vendor / pace / pace-minimal.css',
'vendor / bootstrap / dist / css / bootstrap.min.css',
'../node_modules /sweetalert2/dist/sweetalert2.min.css',
],'public / css / vendors.css','public');

这个工作,并且 gulp watch 再次运行:

  mix.styles([
'../../../public/vendors/jquery- steps / demo / css / jquery.steps.css',
'../../../public/vendors/pace/pace-minimal.css',
'../ .. /../public/vendors/bootstrap/dist/css/bootstrap.min.css',
'../../../node_modules/sweetalert2/dist/sweetalert2.min.css',
],'public / css / vendors.css');

这并不美观,但它有效。


When I try to run gulp watch, I'm getting this error:

stream.js:74
      throw er; // Unhandled stream error in pipe.
      ^

Error: ENOENT: no such file or directory, stat 'XXXX\public\build\css\client-18724fe72d.css'
    at Error (native)

I tried to leave the client.scss file empty, and the error disappeared. I found out that the errors sometimes is appearing when I have these lines in my client.scss:

// Pages
@import 'pages/client/auth';
@import 'pages/client/normals';
@import 'pages/client/orders';

I've already checked each one of them, and there's nothing wrong with the syntax or something like that. Even more, when I run gulp, it works without any errors.

This is my gulpfile.js:

const elixir = require('laravel-elixir');

elixir(mix => {
    mix
        .sass('app.scss')
        .sass('client.scss', 'public/css/client.css')
        .sass('panel.scss', 'public/css/panel.css')
        .copy('resources/assets/fonts', 'public/build/fonts')
        .copy('resources/assets/images', 'public/build/images')
        .webpack('app.js')
        .webpack('panel.js')
        .version(['css/app.css', 'css/client.css', 'css/panel.css', 'js/app.js', 'js/panel.js'])
});

This is the file structure:

Is there something that I'm doing wrong here?

解决方案

Throwing my two cents in here. I had the same issue and it went away as soon as I stopped using the starting / relative path option, and used full relative paths (relative to /resources) instead.

So instead of:

mix.styles([
    'vendors/jquery-steps/demo/css/jquery.steps.css',
    'vendors/pace/pace-minimal.css',
    'vendors/bootstrap/dist/css/bootstrap.min.css',
    '../node_modules/sweetalert2/dist/sweetalert2.min.css',
], 'public/css/vendors.css', 'public');

This worked, and gulp watch ran again:

mix.styles([
    '../../../public/vendors/jquery-steps/demo/css/jquery.steps.css',
    '../../../public/vendors/pace/pace-minimal.css',
    '../../../public/vendors/bootstrap/dist/css/bootstrap.min.css',
    '../../../node_modules/sweetalert2/dist/sweetalert2.min.css',
], 'public/css/vendors.css');

It's not pretty, but it works.

这篇关于Laravel Elixir 6在“吞噬手表”上获得例外的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆