Search code examples
javascriptubuntugulpbrowserifyatom-editor

gulp task finished successfully in usual terminal, but not in the atom terminal


I have one strange issue running gulp task for compiling browserify + coffee, react & bower. Here is my task:

var browserify = require('gulp-browserify');
var coffeeReactify = require('coffee-reactify');
var debowerify = require('debowerify');
var gulp = require('gulp');
var rename = require('gulp-rename');

gulp.task('coffee', function() {
  return gulp.src('./app/assets/javascripts/application.coffee', { read: false })
    .pipe(browserify({
      debug: true,
      transform: [coffeeReactify, debowerify],
      extensions: ['.coffee']
    })).on('error', function(error) {
      console.log('----');
      console.log('Compile error');
      console.log();
      console.log(error.message);
    }).pipe(rename('application.js'))
    .pipe(gulp.dest('./public/'));
});

When I run this task on usual ubuntu's gnome-terminal, all is going well, file is created and worked. But in atom editor terminal coffee isn't compiling. I get this error. So, how can I fix that?

[10:38:15] Using gulpfile ~/my_project/Gulpfile.js
[10:38:15] Starting 'coffee'...
----
Compile error

ENOTDIR: not a directory, open '/usr/share/atom/resources/app.asar/package.json'
[10:38:15] Finished 'coffee' after 57 ms

Other tasks, like gulp slim or gulp sass are working well.


Solution

  • The key to solve this issue was to migrate from gulp-browserify to browserify package.