javascript - Gulp Error: Cannot find module browserify - Stack Overflow

Getting the above error when running gulp. Can't figure out why. I've read a few things such

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.

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.

Share Improve this question edited Dec 7, 2015 at 15:07 Oss 4,3202 gold badges21 silver badges36 bronze badges asked Dec 7, 2015 at 13:52 Max LynnMax Lynn 1,7786 gold badges25 silver badges35 bronze badges 6
  • Nice suggestion but that didn't do it. – Max Lynn Commented Dec 7, 2015 at 13:55
  • Can you post your plete gulp file? – Gerrit Bertier Commented Dec 7, 2015 at 13:56
  • How do you installed that module? – pazitos10 Commented Dec 7, 2015 at 13:57
  • 1 "NOTE: THIS PLUGIN IS NO LONGER MAINTAINED" – robertklep Commented Dec 7, 2015 at 13:57
  • Gerrit, I've updated the ment with everything i've got in my gulp file. I install the module by doing a npm install – Max Lynn Commented Dec 7, 2015 at 13:57
 |  Show 1 more ment

1 Answer 1

Reset to default 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.

发布者:admin,转转请注明出处:http://www.yc00.com/questions/1745135011a4613158.html

相关推荐

  • javascript - Gulp Error: Cannot find module browserify - Stack Overflow

    Getting the above error when running gulp. Can't figure out why. I've read a few things such

    1小时前
    20

发表回复

评论列表(0条)

  • 暂无评论

联系我们

400-800-8888

在线咨询: QQ交谈

邮件:admin@example.com

工作时间:周一至周五,9:30-18:30,节假日休息

关注微信