gulp命令没有在Laravel框架中组合JavaScript文件。给出了奇怪的错误

时间:2015-12-09 14:08:58

标签: node.js laravel gulp laravel-elixir

我在Laravel框架中有以下elixir函数:

var elixir = require('laravel-elixir');
elixir(function(mix) {
   mix.sass('app.scss');
   mix.styles(['bootstrap.min.css','app.css'], null, 'public/css');
   mix.scripts(['bootstrap.min.js','jquery.min.js'], null, 'public/js');
   mix.version('public/css/all.css');
});

null参数应该在public / css文件夹中自动创建all.css,在public / js文件夹中自动创建all.js。正确组合css文件时,javascript文件出现以下错误:

[12:53:30] 'scripts' errored after 952 ms
[12:53:30] Error: Cannot find module '../internal/assignWith'
at Function.Module._resolveFilename (module.js:337:15)
at Function.Module._load (module.js:287:25)
at Module.require (module.js:366:17)
at require (module.js:385:17)
at Object.<anonymous> (/htdocs/t2ci/node_modules/laravel-elixir/node_modules/gulp-babel/node_modules/babel-core/node_modules/lodash/object/assign.js:1:80)
at Module._compile (module.js:435:26)
at Object.Module._extensions..js (module.js:442:10)
at Module.load (module.js:356:32)
at Function.Module._load (module.js:311:12)
at Module.require (module.js:366:17)
[12:53:30] Error in plugin 'run-sequence'
Message:
An error occured in task 'scripts'.

我浪费了几个小时在互联网上寻找解决方案,但我还没有发现任何问题。有人会遇到这种错误吗?

1 个答案:

答案 0 :(得分:2)

您的 node_modules 可能已损坏。在library(data.table) dt = data.table(letters=factor(letters[1:5]), numbers=seq(1:5)) levels(dt$letters) #[1] "a" "b" "c" "d" "e" subdt = dt[numbers <= 3] levels(subdt$letters) #[1] "a" "b" "c" "d" "e" upd.cols = sapply(subdt, is.factor) subdt[, names(subdt)[upd.cols] := lapply(.SD, factor), .SDcols = upd.cols] levels(subdt$letters) #[1] "a" "b" "c" 之后它是否正常工作?