1

Getting the above error when running gulp.

Can't figure out why. I've read a few things such as the gulp.src needs a ./ infront of app.

var gulp       = require('gulp'),
browserify = require('gulp-browserify');

gulp.task('scripts', function () {

gulp.src(['./app/main.js'])
    .pipe(browserify({
        debug: true,
        transform: [ 'reactify' ]
    }))
    .pipe(gulp.dest('./public/'));

});

gulp.task('default', ['scripts']);

Like so..

I've done a npm install so the node module is is where it should be. Its worth pointing out its called gulp-browserify in the node-module.

As well as I've installed browserify globally on my mac.

Let me know your thoughts or if there is any information im missing.

I'm new to react and trying to literally just set up node.js as a backend and create a react environment.

6
  • Nice suggestion but that didn't do it. Commented Dec 7, 2015 at 13:55
  • Can you post your complete gulp file? Commented Dec 7, 2015 at 13:56
  • How do you installed that module? Commented Dec 7, 2015 at 13:57
  • 1
    "NOTE: THIS PLUGIN IS NO LONGER MAINTAINED" Commented Dec 7, 2015 at 13:57
  • Gerrit, I've updated the comment with everything i've got in my gulp file. I install the module by doing a npm install Commented Dec 7, 2015 at 13:57

1 Answer 1

5

gulp-browserify was blacklisted by gulp

You need to use browserify with vinyl-source-stream.

var gulp = require('gulp');
var browserify = require('browserify');
var source     = require('vinyl-source-stream');

gulp.task('browserify', function() {
    return browserify({ entries: ["./app/main.js"] })
        .bundle()
        .pipe(source('main.js'))
        .pipe(gulp.dest('./public/')));
});

Read more here.

Sign up to request clarification or add additional context in comments.

3 Comments

Why did gulp feel they needed to blacklist it?
Thanks for this comment but I'm still getting the same error after installing the npm and using your code. Any ideas?
I am working on a task similar to yours as we are speaking and I created this task and it works great right now. All I did was npm install browserify --save, npm install vinyl-source-stream --save. Make sure to npm uninstall gulp-browserify --save

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.