使用 gulp 编译时出错

Error while compiling with gulp

我同时使用 Laravel ElixrLaravel mix 如下所示并编译 scss 个文件

OS = Windows 10

node -v = v6.11.0

npm --v = 5.0.3

+-- laravel-elixir@6.0.0-15
| `-- gulp-sass@2.3.2
|   `-- node-sass@3.13.1
`-- laravel-mix@0.11.4
  `-- node-sass@4.5.2

错误是找不到模块'cloneable-readable',如下所示

> [05:51:53] Using gulpfile D:\www\fevrok.com\gulpfile.js 
> [05:51:53] Starting 'all'...
> [05:51:53] Starting 'sass'...
> [05:51:54] 'sass' errored after 713 ms
> [05:51:54] Error: Cannot find module 'cloneable-readable'
>     at Function.Module._resolveFilename (module.js:469:15)
>     at Function.Module._load (module.js:417:25)
>     at Module.require (module.js:497:17)
>     at require (internal/module.js:20:19)
>     at Object.<anonymous> (D:\www\fevrok.com\node_modules\gulp-concat\node_modules\vinyl\index.js:8:17)
>     at Module._compile (module.js:570:32)
>     at Object.Module._extensions..js (module.js:579:10)
>     at Module.load (module.js:487:32)
>     at tryModuleLoad (module.js:446:12)
>     at Function.Module._load (module.js:438:3)
> [05:51:54] 'all' errored after 745 ms
> [05:51:54] Error in plugin 'run-sequence(sass)'
> Message:
>     Cannot find module 'cloneable-readable'
> Details:
>     code: MODULE_NOT_FOUND
> Stack:
> Error: Cannot find module 'cloneable-readable'
>     at Function.Module._resolveFilename (module.js:469:15)
>     at Function.Module._load (module.js:417:25)
>     at Module.require (module.js:497:17)
>     at require (internal/module.js:20:19)
>     at Object.<anonymous> (D:\www\fevrok.com\node_modules\gulp-concat\node_modules\vinyl\index.js:8:17)
>     at Module._compile (module.js:570:32)
>     at Object.Module._extensions..js (module.js:579:10)
>     at Module.load (module.js:487:32)
>     at tryModuleLoad (module.js:446:12)
>     at Function.Module._load (module.js:438:3)

我通过安装缺少的模块来修复它

npm install cloneable-readable
npm install clone-buffer

在我的例子中,就是上面那两个