/node_modules/jpegtran-bin/vendor/jpegtran: Syntax error: "(" unexpected in file

Hi,

I have commented out one section that references a giant image library and attached a small images directory images.tar.gz

My grunt file is running successfully locally on my MacBook pro but not on my Ubuntu Plesk server, not sure what is wrong I get the following error message:

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.

Have also tried getting the latest version of grunt-contrib-imagemin.

For that I did

npm uninstall --save-dev grunt-contrib-imagemin

and then

npm install --save-dev grunt-contrib-imagemin

Grunt file 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']);

};

Open in new window

Jeremy LeysTechnical LeadAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Jeremy LeysTechnical LeadAuthor Commented:
Attempting to upload images.tar.gz again only 4.7mb.
0
Jeremy LeysTechnical LeadAuthor Commented:
Keeping failing to upload this 4.7mb tar.gz file so have instead provided a dropbox link:
images.tar.gz
0
Jeremy LeysTechnical LeadAuthor Commented:
To unzip the images.tar.gz

tar -zxvf images.tar.gz
0
Jeremy LeysTechnical LeadAuthor Commented:
0
Jeremy LeysTechnical LeadAuthor Commented:
Found the solution myself, see my answer on stack overflow, can't be bothered writing a detailed answer here too:

http://stackoverflow.com/questions/33744925/node-modules-jpegtran-bin-vendor-jpegtran-syntax-error-unexpected-in-file
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
JavaScript

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.