I encountered a strange error while working on my project. The error message I received is as follows:
$ gulp browserify [01:21:03] Using gulpfile F:\CSC Assignments\FinalProject\HotelProject\gulpfile.js [01:21:03] Starting 'browserify'... [01:21:03] 'browserify' errored after 15 ms [01:21:03] ReferenceError: source is not defined at Gulp. (F:\CSC Assignments\FinalProject\HotelProject\gulpfile.js:109:15) at module.exports (F:\CSC Assignments\FinalProject\HotelProject\node_modules\gulp\node_modules\orchestrator\lib\runTask.js:34:7) at Gulp.Orchestrator._runTask (F:\CSC Assignments\FinalProject\HotelProject\node_modules\gulp\node_modules\orchestrator\index.js:273:3) at Gulp.Orchestrator._runStep (F:\CSC Assignments\FinalProject\HotelProject\node_modules\gulp\node_modules\orchestrator\index.js:214:10) at Gulp.Orchestrator.start (F:\CSC Assignments\FinalProject\HotelProject\node_modules\gulp\node_modules\orchestrator\index.js:134:8) at C:\Users\LUCKYLAM\AppData\Roaming\npm\node_modules\gulp\bin\gulp.js:129:20 at process._tickCallback (node.js:355:11) at Function.Module.runMain (module.js:503:11) at startup (node.js:129:16) at node.js:814:3
I'm quite new to this and despite spending some time trying to troubleshoot the issue, I'm still unable to identify the root cause. Any assistance would be greatly appreciated.
Below is an excerpt from my script.js file located in /app/js/ directory:
require('angular');
var app = angular.module('app', []);
This is the content of my gulpfile.js:
gulp.task('browserify', function() {
return browserify('./app/js/script.js')
.bundle()
.pipe(source('main.js'))
// saves it to the public/js/ directory
.pipe(gulp.dest('./dist/js/kk/'));
});
For reference, here is the folder structure https://i.sstatic.net/GXBGJ.png