node.js and Gulp errors

Good day, I’m new to Gulp and Node Js, I’ve been getting this error (shown below), I’ve done some research and I’ve not found any fixes.
"[Browserslist] Could not parse /Users/gendyblackman/Sites/blackmanimages/package.json. Ignoring it.
assert.js:269
throw err;
^
AssertionError [ERR_ASSERTION]: Task never defined: clean
at getFunction (/Users/gendyblackman/Sites/blackmanimages/node_modules/undertaker/lib/helpers/normalizeArgs.js:15:5)
at map (/Users/gendyblackman/Sites/blackmanimages/node_modules/arr-map/index.js:20:14)
at normalizeArgs (/Users/gendyblackman/Sites/blackmanimages/node_modules/undertaker/lib/helpers/normalizeArgs.js:22:10)
at Gulp.series (/Users/gendyblackman/Sites/blackmanimages/node_modules/undertaker/lib/series.js:13:14)
at Object. (/Users/gendyblackman/Sites/blackmanimages/gulpfile.js:115:9)
at Module._compile (internal/modules/cjs/loader.js:702:30)
at Object.Module._extensions…js (internal/modules/cjs/loader.js:713:10)
at Module.load (internal/modules/cjs/loader.js:612:32)
at tryModuleLoad (internal/modules/cjs/loader.js:551:12)
at Function.Module._load (internal/modules/cjs/loader.js:543:3)

Also, when I reinstall Gulp locally I get these errors, shown below.
npm ERR! file /Users/gendyblackman/Sites/blackmanimages/package.json
npm ERR! code EJSONPARSE
npm ERR! JSON.parse Failed to parse json
npm ERR! JSON.parse Unexpected string in JSON at position 734 while parsing ‘{
npm ERR! JSON.parse “name”: “blackmanimages”,
npm ERR! JSON.parse "version’
npm ERR! JSON.parse Failed to parse package.json data.
npm ERR! JSON.parse package.json must be actual JSON, not just JavaScript.
npm ERR! A complete log of this run can be found in:
npm ERR! /Users/gendyblackman/.npm/_logs/2018-07-05T14_56_20_043Z-debug.log
Any help would be great.
Thanks,

Also, heres my Gulpfile.js 

var gulp = require(‘gulp’);
var copy = require(‘gulp-contrib-copy’);
var concat = require(‘gulp-concat’);
var uglify = require(‘gulp-uglify’);
var browserSync = require(‘browser-sync’).create();
var sass = require(‘gulp-sass’);
var sass = require(‘gulp-scss’);
var autoprefixer = require(‘gulp-autoprefixer’);
var imagemin = require(‘gulp-imagemin’);
var minifyCSS = require(‘gulp-minify-css’);
var sourcemaps = require(‘gulp-sourcemaps’);
var plumber = require(‘gulp-plumber’);
var rename = require(‘gulp-rename’);
var mamp = require(‘gulp-mamp’);
var mysql = require(‘MySql’);
var express = require(‘express’);
var cache = require(‘gulp-cache’);

var useref = require(‘gulp-useref’);
var gulpIf = require(‘gulp-if’);

var cssnano = require(‘gulp-cssnano’);
var runSequence = require(‘run-sequence’);

//path
var stylesrc=‘source/sass/**/*.sass’;
var styleDest = ‘build/assets/css/’;
var htmlsrc=‘source/’;
var htmlDest = ‘build/’;
var vendorsrc=‘source/js/vendors/’;
var vendorDest = ‘build/assets/js/’;
var scriptsrc=‘source/js/*.js’;
var scriptDest = ‘build/assets/js/’;
var fontsrc=’/source/fonts/**/*’;
var fontDect = ‘/build/assets/fonts/’;
var imgsrc=’/source/img/**/*’;
var fontDect = ‘/build/assets/img/’;
// --------------------------------------------
// Stand Alone Tasks
// --------------------------------------------

// Compiles all SASS files
gulp.task(‘scss’, function () {
return gulp.src(‘source/scss/**/*.scss’)
.pipe(plumber())
.pipe(scss({
style: ‘compressed’,
}))
.pipe(rename({
basename: ‘main’,
suffix: ‘.min’,
}))

.pipe(gulp.dest(‘build/assets/css’))
.pipe(browserSync.stream());
});

// Optimizing Images
gulp.task(‘images’, function () {
return gulp.src(‘source/img/**/*.+(png|jpg|gif|svg)’)
.pipe(cache(imagemin({
interlaced: true
})))
.pipe(gulp.dest(‘build/assets/img’));
});
// Fontd
gulp.task(‘fonts’, function() {
return gulp.src(‘source/fonts/**/*’)
.pipe(gulp.dest(‘build/assets/fonts’))
})

// Uglify js files
gulp.task(‘scripts’, function () {
gulp.src(‘source/js/*.js’)
.pipe(plumber())
.pipe(uglify())
.pipe(gulp.dest(‘build/assets/js’))
.pipe(browserSync.stream());
});

//Concat and Compress Vendor .js files
gulp.task(‘vendors’, function () {
gulp.src(
[
‘source/js/vendors/jquery.min.js’,
‘source/js/vendors/*.js’,
])
.pipe(plumber())
.pipe(concat(‘vendors.js’))
.pipe(uglify())
.pipe(gulp.dest(‘build/assets/js’));
});

// Watch for changes
gulp.task(‘watch’, function () {
//Serve files from the root of this project
browserSync.init({
server: {
baseDir: “./build”,
},
notify: false
});

gulp.watch(styleSrc, [‘scss’]);
gulp.watch(scriptSrc, [‘scripts’]);
gulp.watch(vendorSrc, [‘vendors’]);
gulp.watch([‘build/*.html’, ‘build/assets/css/*.css’, ‘build/assets/js/*.js’, ‘build/assets/js/vendors/*.js’ , ‘/build/assets/img/*’ , ‘/build/assets/img/’])
.on(’ change ', browserSync.reload);

});

//use default task to launch Browsersync and watch JS files
gulp.task(
‘default’,
gulp.series(
‘clean’,
gulp.parallel(‘scss’, ‘scripts’, ‘vendors’,images,fonts, ‘watch’) , function (){
console.log(‘Building files’);
}));

//gulp.task(‘default’, [‘sass’, ‘scripts’, ‘vendors’, ‘watch’], function () {
//console.log(‘Building files’);
//});

gulp.task(‘default’, function (callback) {
runSequence([‘sass’,‘browserSync’, ‘watch’],
callback
)
})

Dumping an error message here will not fix your problem. You might want to try and tell us:

  • what it is you’re trying to achieve
  • what you’ve already tried/found to fix it

When posting code, it’s best to post it in snippets so that there is a clearer discretion between code and text. Next time, try using the “Insert Code” button to input your code snippets to make it easier for people to help. :heart:

As to your problem, it looks like there are two issues: first, your gulp file never specifies a “clean” command, and second, your package.json looks like it is not formatted correctly. Can you post, in a snippet, the contents of your package.json file? I think that’s where we’ll find the culprit.