What did I do to install Babel on gulp:
- npm i babili --save-dev
- Zarekvail package in gulpfile.js
And I don’t know why it doesn’t work ... Everywhere they write this kind of code (below) + the command that I brought, and everything, in theory, everything should work.
Here is a haplfile with a js taxi:
var gulp = require('gulp'), babel = require('babili'); gulp.task('js', function() { gulp.src([ 'assets/_js/*.js' ]) .pipe(babel({presets: ['babili']})) .pipe(gulp.dest('_site/assets/js')) }); And here is the error:
[01:08:34] Starting 'js'... [01:08:34] 'js' errored after 2.72 ms [01:08:34] TypeError: babel is not a function at Gulp.<anonymous> (C:\Jekyll\vostoksisters\gulpfile.js:77:11) at module.exports (C:\Jekyll\vostoksisters\node_modules\orchestrator\lib\runTask.js:34:7) at Gulp.Orchestrator._runTask (C:\Jekyll\vostoksisters\node_modules\orchestrator\index.js:273:3) at Gulp.Orchestrator._runStep (C:\Jekyll\vostoksisters\node_modules\orchestrator\index.js:214:10) at C:\Jekyll\vostoksisters\node_modules\orchestrator\index.js:279:18 at finish (C:\Jekyll\vostoksisters\node_modules\orchestrator\lib\runTask.js:21:8) at module.exports (C:\Jekyll\vostoksisters\node_modules\orchestrator\lib\runTask.js:60:3) at Gulp.Orchestrator._runTask (C:\Jekyll\vostoksisters\node_modules\orchestrator\index.js:273:3) at Gulp.Orchestrator._runStep (C:\Jekyll\vostoksisters\node_modules\orchestrator\index.js:214:10) at Gulp.Orchestrator.start (C:\Jekyll\vostoksisters\node_modules\orchestrator\index.js:134:8) at Gulp.<anonymous> (C:\Jekyll\vostoksisters\node_modules\gulp-sync\lib\index.js:51:27) at module.exports (C:\Jekyll\vostoksisters\node_modules\orchestrator\lib\runTask.js:34:7) at Gulp.Orchestrator._runTask (C:\Jekyll\vostoksisters\node_modules\orchestrator\index.js:273:3) at Gulp.Orchestrator._runStep (C:\Jekyll\vostoksisters\node_modules\orchestrator\index.js:214:10) at Gulp.Orchestrator.start (C:\Jekyll\vostoksisters\node_modules\orchestrator\index.js:134:8) at C:\Users\Vostok Sisters\AppData\Roaming\npm\node_modules\gulp\bin\gulp.js:129:20 hard doesn't exist