Jeff Jeff - 1 year ago 391
jQuery Question

Gulp - jQuery is not defined

My gulp application seems to work fine but the jQuery doesn't get executed for some reason. I am new to Gulp and I can't figure out this issue.

This is my gulpfile.js

var gulp = require('gulp');
var sass = require('gulp-sass');
var jshint = require('gulp-jshint');
var stylish = require('jshint-stylish');
var concat = require('gulp-concat');
var uglify = require('gulp-uglify');
var rename = require("gulp-rename");
var imagemin = require('gulp-imagemin');
var plumber = require('gulp-plumber');
var fixmyjs = require("gulp-fixmyjs");
var browserSync = require('browser-sync').create();
var reload = browserSync.reload;

// sass
gulp.task('sass', function () {

// js
gulp.task('js', function () {
.pipe(rename({suffix: '.min'}))
"asi": true
.pipe(uglify().on('error', function(e){

gulp.task('images', function() {
optimizationLevel: 7,
progressive: true

// browser sync and watch
gulp.task('watch', function() {
files: ['./**/*.php'],
proxy: 'http://neontetra.local/',
});'./sass/**/*.scss', ['sass', reload]);'./js/src/*.js', ['js', reload]);'./src/images/*', ['images', reload]);

gulp.task('default', ['sass', 'images', 'js', 'watch']);

This is package.json

"name": "neontetra",
"version": "1.0.0",
"description": "[![Build Status](](",
"main": "index.js",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
"author": "",
"license": "ISC",
"dependencies": {
"browser-sync": "^2.17.3",
"gulp-concat": "^2.6.0",
"gulp": "^3.9.1",
"gulp-fixmyjs": "^1.0.2",
"gulp-imagemin": "^3.0.3",
"gulp-jshint": "^2.0.1",
"gulp-plumber": "^1.1.0",
"gulp-sass": "^2.3.2",
"gulp-rename": "^1.2.2",
"gulp-uglify": "^2.0.0",
"jquery": "^3.1.1",
"jshint": "^2.9.3",
"jshint-stylish": "^2.2.1"
"devDependencies": {


And here is the main.js

"use strict";

The console panel throws the error
Uncaught ReferenceError: jQuery is not defined

What do I have to do for jQuery to work with Gulp?

Answer Source

Did you make sure that you download jQuery libraries before everything else?

<script src=""></script>
Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download