Comments (24)
Just change this:
return cp.spawn('jekyll', ['build'], {stdio: 'inherit'}).on('close', done);
for this:
return cp.exec('jekyll', ['build'], {stdio: 'inherit'}).on('close', done);
from jekyll-gulp-sass-browser-sync.
To keep your code platform independent, you can add
var jekyll = process.platform === "win32" ? "jekyll.bat" : "jekyll";
and then use
return cp.spawn(jekyll, ['build'], {stdio: 'inherit'}).on('close', done);
from jekyll-gulp-sass-browser-sync.
My new build a starter project with Jekyll and other tools (Win, Mac, Lin): https://github.com/agragregra/jekyll-gulp-autoprefixer-sass-bourbon-jade-browser-sync
from jekyll-gulp-sass-browser-sync.
hi there! I face this problem and I tried to use the command line prompt with ruby. and worked!
from jekyll-gulp-sass-browser-sync.
Hi there
Sorry I havn't tested this on windows yet - can you compile Jekyll normally from the command line (without using gulp)?
from jekyll-gulp-sass-browser-sync.
Jekyll works fine on command-line. My workaround is use Grunt to launch BrowserSync.
from jekyll-gulp-sass-browser-sync.
@sergiokopplin have you tested this works on windows?
from jekyll-gulp-sass-browser-sync.
I tried, without success, had seen this on stackoverflow and it seemed to work.
Incidentally, I went back to using the browser-sync today and I came across many problems and could not use. Other browsers can not connect to internal network of my house. I used both the browser-sync in its simple form, as well as the Grunt and the Gulp.
from jekyll-gulp-sass-browser-sync.
Updating.
I had a problem on my machine because I could not run the browser-sync, asked for help from friends and some developers still unable to diagnose. I formatted the machine and now it worked without problems.
Follows the line I changed:
('Jekyll', ['build'], {stdio: 'inherit'}) return cp.exec
from jekyll-gulp-sass-browser-sync.
I had similar issue and used:
return cp.spawn('jekyll.bat', ['build'], {stdio: 'inherit'}).on('close', done);
from jekyll-gulp-sass-browser-sync.
It also fails on Mac OS 10.10
--- OSS/jekyll-gulp-sass-browser-sync ‹master› » gulp
[11:57:25] Using gulpfile ~/Projects/OSS/jekyll-gulp-sass-browser-sync/gulpfile.js
[11:57:25] Starting 'sass'...
[11:57:25] Starting 'jekyll-build'...
[11:57:25] Starting 'watch'...
[11:57:25] Finished 'watch' after 10 ms
events.js:72
throw er; // Unhandled 'error' event
^
Error: spawn ENOENT
at errnoException (child_process.js:1001:11)
at Process.ChildProcess._handle.onexit (child_process.js:792:34)
from jekyll-gulp-sass-browser-sync.
I've added an error handler to the gulpfile.js to track the error and here we go:
--- OSS/jekyll-gulp-sass-browser-sync ‹master* M› » gulp
[21:11:14] Using gulpfile ~/Projects/OSS/jekyll-gulp-sass-browser-sync/gulpfile.js
[21:11:14] Starting 'sass'...
[21:11:14] Starting 'jekyll-build'...
[21:11:14] Starting 'watch'...
[21:11:14] Finished 'watch' after 10 ms
Error: spawn ENOENT
[21:11:14] 'jekyll-build' errored after 16 ms
[21:11:14] Error: -1
at formatError (/usr/local/lib/node_modules/gulp/bin/gulp.js:169:10)
at Gulp.<anonymous> (/usr/local/lib/node_modules/gulp/bin/gulp.js:195:15)
at Gulp.emit (events.js:95:17)
at Gulp.Orchestrator._emitTaskDone (/Users/okonet/Projects/OSS/jekyll-gulp-sass-browser-sync/node_modules/gulp/node_modules/orchestrator/index.js:264:8)
at /Users/okonet/Projects/OSS/jekyll-gulp-sass-browser-sync/node_modules/gulp/node_modules/orchestrator/index.js:275:23
at finish (/Users/okonet/Projects/OSS/jekyll-gulp-sass-browser-sync/node_modules/gulp/node_modules/orchestrator/lib/runTask.js:21:8)
at ChildProcess.cb (/Users/okonet/Projects/OSS/jekyll-gulp-sass-browser-sync/node_modules/gulp/node_modules/orchestrator/lib/runTask.js:29:3)
at ChildProcess.emit (events.js:98:17)
at maybeClose (child_process.js:756:16)
at Process.ChildProcess._handle.onexit (child_process.js:823:5)
Still unclear why it's happening. I've installed jekyll
using gem install jekyll
which jekyll
jekyll: aliased to bundled_jekyll
from jekyll-gulp-sass-browser-sync.
The problem was the bundler
. In this case it should look like:
return cp.spawn('bundle', ['exec', 'jekyll', 'build'], {stdio: 'inherit'})
from jekyll-gulp-sass-browser-sync.
Installing another Ruby version worked for me (2.1.6).
from jekyll-gulp-sass-browser-sync.
[15:06:32] Task 'install' is not in your gulpfile
[15:06:32] Please check the documentation for proper gulpfile formatting
What should I do, can anyone help me ?
from jekyll-gulp-sass-browser-sync.
it doesn't work on windows anyhow... using jekyll independently is good...
from jekyll-gulp-sass-browser-sync.
Hi, When I run the command gulp and my browser opens in localhost:3000 I get the error 'Cannot GET /'
from jekyll-gulp-sass-browser-sync.
@AcarMeel, did you checked another url like "localhost:3000/index.html"? Or maybe with your application folder. In my case my url is like "localhost:3000/app/index.html"
from jekyll-gulp-sass-browser-sync.
@sergiokopplin but in my _site folder I don't have any html file (index.html) . Is not compiling any html files just the styles.
from jekyll-gulp-sass-browser-sync.
anyone found a solution for this script on Windows? I tried lots of methods but none seems to work, I'm using this on Windows 10. Thanks in advanced!
*Edit: Okay, so I used the code below:
gulp.task('jekyll-build', function (done){
//var jekyll = process.platform === "win32" ? "jekyll.bat" : "jekyll";
return cp.spawn('jekyll.bat', ['build'], {stdio: 'inherit'})
.on('close', done);
});
and it worked, but I had to exclude node_modules in my _config.yml. And also my rebuild task is taking a bit slow, I will try to optimize it and post the code here :)
Thanks Shane for making this script! 👍
from jekyll-gulp-sass-browser-sync.
This is my gulpfile for Jekyll to work with Gulp on Windows (10), anyone who want the script please feel free to download and use it and also Star the repo if you like it :)
Again thanks Shane for uploading the original work, mine just has different structures and modified gulpfile so it can work on Windows.
https://github.com/steven-to/gulp-jekyll-browsersync/blob/gh-pages/gulpfile.js
from jekyll-gulp-sass-browser-sync.
You can use gulp-shell to run jekyll or bunlde exec jekyll
var shell = require('gulp-shell');
// Task for building blog when something changed:
gulp.task('jekyll-build', shell.task(['bundle exec jekyll build']));
// Or if you don't use bundle:
// gulp.task('build', shell.task(['jekyll build']));
from jekyll-gulp-sass-browser-sync.
nah, you shouldn't.
"gulp-shell": "promotes anti-patterns, use gulp-exec or child_process"
https://github.com/gulpjs/plugins/blob/master/src/blackList.json
from jekyll-gulp-sass-browser-sync.
Yeah! like @MuhammadSayedMorsi said windows users please use the 'command line prompt with ruby' to run the gulp. It will work!.
from jekyll-gulp-sass-browser-sync.
Related Issues (20)
- Would this project add min css/js automation? HOT 2
- Command failed: git rev-list --pretty=raw --max-count=1 HOT 1
- events.js:160 throw er; // Unhandled 'error' event HOT 5
- Purpose of duplicate css dest? HOT 1
- Bourbon import is failing
- CSS/SASS doesn't automatically get applied after running gulp. HOT 2
- Issue - Gulp file not found
- Injecting dependencies with bower
- Try to add folder with htmls which I want to use with AJAX to the browsersync baseDir
- jekyll-build error HOT 3
- How to send only main.css file to the _site folder and send *.js files to one bundle.js into _site folder ?
- 'gulp error' HOT 3
- Task 'pug' is not in your gulpfile HOT 2
- Browser sync doesn't work on pages that aren't my index .html HOT 1
- License not immediately clear
- adding es2015
- How to disable the browser sync
- Gulp does not compile after direct editing on includes
- Update Gulpfile.js 3 to 4 HOT 4
- [Resolved] Gulp update and npm install issue on windows
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from jekyll-gulp-sass-browser-sync.