Grunt / Babel error: Unable to write "dist" file (Error code: EISDIR)
<p>I am new to Grunt and all its plugins, but I want to learn and setup some awesome front-end tools. With that said, I have been following the <a href="http://gruntjs.com/creating-tasks" rel="nofollow">Grunt docs</a> and some's similar issue with Grunt and Babel via <a href="https://github.com/babel/grunt-babel/issues/31" rel="nofollow">Github</a>, but I seem to keep getting the following traceback: </p>

<pre><code>Running "babel:dist" (babel) task
Warning: Unable to write "dist" file (Error code: EISDIR). Use --force to continue.

Aborted due to warnings.
</code></pre>

<p>Any clearer explanation to this newbie would be HIGHLY appreciated. I'm new to programming in JS and setting up DevOps, so some helpful tips and best practices are encouraged. </p>

<hr>

<p>Setup: </p>

<p>js_practice/ (Root Project) <br>
|----package.json<br>
<br>
All the distributions and packages<br>
|---node_modules/<br>
<br>
Server-Side (Node) support<br>
|---es6/<br>
| ------ test.js <br>
|---dist/<br>
<br>
Client (browser) support<br>
|----public/<br>
|---es6/ (this is within the public folder) <br>
| ----- test2.js <br>
|---dist/ (this is within the public folder) <br></p>

<p>Here is my current code: </p>

<p><strong>Grunt file.js</strong></p>

<pre><code>module.exports = function(grunt) {
        // All of your Grunt code must be specified inside this function!
        // Setup configuration...
    // Load tasks...
    // Define tasks...

    grunt.initConfig({
            pkg: grunt.file.readJSON('package.json'),
            babel: {
                     options: {
                             sourceMap: true,
                             presets: ['babel-preset-es2015']
                     },
                     dist: {
                             files: [
                                 // Node source
                                 {
                                 src: ['es6/**/*.js'],
                                 dest: 'dist'},
                                 // Browser source
                                {
                                    src: ['public/es6/**/*.js'],
                                    dest: 'public/dist'},
                        ],
                    },
             },

            browserify: {
           dist: {
             options: {
               transform: [["babelify", { "stage": 0 }]]
             },
             files: {
               "build/bundle.js": "src/main.js"
             }
           }
             },

        jshint: {
            scripts: {
                src: ['scripts/**.js', 'lib/**.js']
            },

            tests: { // We can have more than one jshint task, this ones called `jshint:tests`
                src: 'tests/**.js'
            }
        },

                uglify: {
              options: {
                banner: '/*! &lt;%= pkg.name %&gt; &lt;%= grunt.template.today("yyyy-mm-dd") %&gt; */\n'
              },
              build: {
                src: 'src/&lt;%= pkg.name %&gt;.js',
                dest: 'build/&lt;%= pkg.name %&gt;.min.js'
              },
            scripts: {
                expand: true,
                cwd: 'scripts/',
                src: '**.js',
                dest: 'build/',
                ext: '.min.js'
            }
        },

        watch: {
                    scripts: {
                    files: ['**/*.js'],
                    tasks: ['jshint'],
                        },

            styles: {
                files: 'styles/**.less',
                task: 'less:styles'
            }
        }

    });

    grunt.loadNpmTasks('grunt-contrib-jshint');
    grunt.loadNpmTasks('grunt-contrib-uglify');
    grunt.loadNpmTasks('grunt-contrib-less');
    grunt.loadNpmTasks('grunt-contrib-watch');
    grunt.loadNpmTasks('grunt-browserify');
    grunt.loadNpmTasks('grunt-babel');

    grunt.registerTask('default', ['babel','browserify','jshint']);
    grunt.registerTask('build', ['jshint', 'uglify']);

};
</code></pre>