title: Running grunt on windows 8
body: <p>I am trying to run grunt on an existing project on a windows 8 machine.
  I've installed grunt-cli globally,by running:</p>
  
  <pre><code>npm install -g grunt-cli
  </code></pre>
  
  <p>However when trying to run the project with: </p>
  
  <pre><code>grunt develop 
  </code></pre>
  
  <p>I get this error:</p>
  
  <pre><code>Warning: Unable to write "preview.html" file &lt;Error code: EPERM&gt;. Use --force to continue.
  Aborted due to warnings.
  </code></pre>
  
  <p>Then when running </p>
  
  <pre><code>grunt develop --force
  </code></pre>
  
  <p>I get this error:</p>
  
  <pre><code>Running "less:css/main.css" &lt;less&gt; task
  Fatal error: Unable to write "css/main.css" file &lt;Error code: EPERM&gt;.
  </code></pre>
  
  <p>Any help you could provide on this would be most helpful, 
  thanks.</p>
  
  <h2>Update 1:</h2>
  
  <p>This is my Gruntfile.js </p>
  
  <pre><code>module.exports = function(grunt){
  
    grunt.initConfig({
      watch: {
        less: {
          files: ['**/*.less', '!less/_compiled-main.less'],
          tasks: 'less'
      },
      html: {
          files: ['preview-template.html', 'js/**/*.js', 'less/**/*.less', '!less/_compiled-main.less'],
          tasks: ['includeSource', 'add-dont-edit-prefix-to-preview-html']
      },
      wysiwyg: {
          files: ['less/wysiwyg.less'],
          tasks: 'generate-wysiwyg-styles-js'
      }
  },
  less: {
    'css/main.css': 'less/_compiled-main.less',
    'css/wysiwyg.css': 'less/wysiwyg.less',
    options: {
      dumpLineNumbers: 'comments'
  }
  },
  includeSource: {
    options: {
      templates: {
  
      },
  },
  dev: {
      files: {
        'preview.html': 'preview-template.html',
        'less/_compiled-main.less': 'less/main.less'
    }
  }
  },
  connect: {
    server: {
      options: {
        base: '.',
        port: 8000
    }
  }
  }
  });
  
    // Css preprocessor
    grunt.loadNpmTasks('grunt-contrib-less');
    // Watch for file changes and run other grunt tasks on change
    grunt.loadNpmTasks('grunt-contrib-watch');
    // Includes all js files in preview-template.html and saves as preview.html.
    // Includes all less files in main.less and saves as _compiled-main.less
    grunt.loadNpmTasks('grunt-include-source');
    // Static http server
    grunt.loadNpmTasks('grunt-contrib-connect');
  
    grunt.registerTask('generate-wysiwyg-styles-js', function(){
      var css = grunt.file.read('css/wysiwyg.css');
      css = css.replace(/\n/g, '')
      var js = '// This file is generated automatically based on wysiwyg.less - don\' edit it directly!\n';
      js += '// It needs to exist in JS form so we can include the CSS in the downloaded saved notes file';
      js += "\napp.value('wysiwygStyles', '" + css + "');";
      grunt.file.write('js/app/wysiwyg-styles.js', js)
  })
  
    grunt.registerTask('add-dont-edit-prefix-to-preview-html', function(){
      var file = grunt.file.read('preview.html');
      var prefix = '&lt;!-- \n\n\n\n Don\'t edit this file, edit preview-template.html instead.' + new Array(20).join('\n') + ' --&gt;';
      file = file.replace('&lt;!doctype html&gt;', '&lt;!doctype html&gt;' + prefix)
      grunt.file.write('preview.html', file);
  });
  
    grunt.registerTask('build-develop', [
      'includeSource',
      'less',
      'generate-wysiwyg-styles-js',
      'add-dont-edit-prefix-to-preview-html'
      ])
  
    grunt.registerTask('develop', [
      'build-develop',
      'connect:server',
      'watch'
      ]);
  }
  </code></pre>