title: /node_modules/jpegtran-bin/vendor/jpegtran: Syntax error: "(" unexpected in file
body: <p>My grunt file is running successfully locally on my MacBook pro but not on my Ubuntu Plesk server, not sure what is wrong. Thank you so much for your help.</p>
  
  <p>I have commented out one section that references a giant image library and attached a small images directory in dropbox images.tar.gz</p>
  
  <p><a href="https://db.tt/JmKF3SuI" rel="nofollow">images.tar.gz</a></p>
  
  <p>to unzip in terminal:</p>
  
  <p><strong>tar -zxvf images.tar.gz</strong></p>
  
  <p>How to remove annoying ._ files generated by OSX:</p>
  
  <p>root@vs1:/images# <strong>find . -iname '._*' -exec rm -rf {} \;</strong></p>
  
  <p><strong>I get the following error message:</strong></p>
  
  <p>Running "imagemin:dynamic" (imagemin) task
  Warning: Error: Error: write EPIPE/var/www/vhosts/staging.specialistreferrals.co.nz/httpdocs/node_modules/jpegtran-bin/vendor/jpegtran: 1: /var/www/vhosts/staging.specialistreferrals.co.nz/httpdocs/node_modules/jpegtran-bin/vendor/jpegtran: Syntax error: "(" unexpected
   in file images/CM_logo.jpg Use --force to continue.</p>
  
  <p>Have also tried getting the latest version of grunt-contrib-imagemin.</p>
  
  <p>For that I did</p>
  
  <p>npm uninstall --save-dev grunt-contrib-imagemin </p>
  
  <p>and then</p>
  
  <p>npm install --save-dev grunt-contrib-imagemin</p>
  
  <p>Grunt file code:</p>
  
  <pre><code>module.exports = function(grunt) {
  
  // Project configuration.
  grunt.initConfig({
  
  pkg: grunt.file.readJSON('package.json'),
  
  // minifying .js files
  uglify: {
    my_target: {
      files: [{
        // javascript folder
        expand: true,
        cwd: 'js/',
        src: ['*.js'],
        dest: 'js/js_opt/',
        ext: '.min.js'
      },
      {
        // slimbox folder
        src: ['slimbox-2.05/js/slimbox2.js'],
        dest: 'slimbox-2.05/js/slimbox2.min.js'
      }]
    }
  },
  
  imagemin: {
    dynamic: {
      files: [{
        expand: true,
        cwd: 'images/',
        src: ['*.{jpg,png,gif}'],
        dest: 'images_opt/'
  //        },
  //      {
  //          expand: true,
  //          cwd: 'SR_images/',
  //          src: ['*.{jpg,png,gif}'],
  //          dest: 'SR_images_opt/'
      }]
    }
  },
  
  
  cssmin: {
    target: {
      files: [{
        // css folder
        expand: true,
        cwd: 'css/',
        src: ['*.css', '!*.min.css'],
        dest: 'css/css_opt/',
        ext: '.min.css'
      },
      {
        // jquery folder
        expand: true,
        cwd: 'js/jquery-1.10.4/',
        src: ['*.css', '!*.min.css'],
        dest: 'js/jquery-1.10.4/',
        ext: '.min.css'        
      },
      {
        // slimbox folder
        expand: true,
        cwd: 'slimbox-2.05/css/',
        src: ['*.css'],
        dest: 'slimbox-2.05/css/',
        ext: '.min.css'
      },
      {
        // fancybox folder
        expand: true,
        cwd: 'js/fancybox/source/',
        src: ['*.css'],
        dest: 'js/fancybox/source/',
        ext: '.min.css'
      }],
    }
  },
  
  watch: {
    scripts: {
      files: 'js/*.js',
      tasks: ['uglify'],
    },
  
    images: {
      files: ['images/*.{jpg,png,gif}'],
      tasks: ['imagemin'],
    },
  
    css: {
      files: 'css/*.css',
      tasks: ['cssmin'],
    }
  }
  
  });
  
  // Load the plugin that provides the "uglify" task.
  grunt.loadNpmTasks('grunt-contrib-uglify');
  grunt.loadNpmTasks('grunt-contrib-cssmin');
  grunt.loadNpmTasks('grunt-contrib-imagemin');
  grunt.loadNpmTasks('grunt-contrib-watch');
  
  // Default task(s).
  grunt.registerTask('default', ['uglify', 'imagemin', 'cssmin', 'watch']);
  
  };
  </code></pre>