Browserify / Electron / AngularJS Error: fs.existsSync is not a function

I’m getting a Error: fs.existsSync is not a function code after I bundle my code using Browserify.

Before I’ve tried to use require() but I kept getting Error: require is not defined due to require function not supported on client side. Browserify seems a solution to use. I’ve managed to solve require error with browserify but another one came up – fs.existsSync is not a function.

Here is the error code as shown on my console:

Error: fs.existsSync is not a function
[159]</</[email protected]://127.0.0.1:8080/services/bundle.js:169566:35
[160]</<@http://127.0.0.1:8080/services/bundle.js:169992:29
[email protected]://127.0.0.1:8080/views/assets/js/vendors/angular.js:4718:19
[email protected]://127.0.0.1:8080/views/assets/js/vendors/angular.js:4557:37
[email protected]://127.0.0.1:8080/views/assets/js/vendors/angular.js:4718:19
createInjector/protoInstanceInjector<@http://127.0.0.1:8080/views/assets/js/vendors/angular.js:4517:37
[email protected]://127.0.0.1:8080/views/assets/js/vendors/angular.js:4664:39
[email protected]://127.0.0.1:8080/views/assets/js/vendors/angular.js:4688:58
[email protected]://127.0.0.1:8080/views/assets/js/vendors/angular.js:4730:18
[email protected]://127.0.0.1:8080/views/assets/js/vendors/angular.js:10369:28
compile/<@http://127.0.0.1:8080/views/assets/js/vendors/angular-ui-router.js:4081:28
bind/<@http://127.0.0.1:8080/views/assets/js/vendors/angular.js:1247:18
[email protected]://127.0.0.1:8080/views/assets/js/vendors/angular.js:9934:9
[email protected]://127.0.0.1:8080/views/assets/js/vendors/angular.js:9335:11
[email protected]://127.0.0.1:8080/views/assets/js/vendors/angular.js:8620:13
[email protected]://127.0.0.1:8080/views/assets/js/vendors/angular.js:8500:30
[email protected]://127.0.0.1:8080/views/assets/js/vendors/angular.js:8844:25
[email protected]://127.0.0.1:8080/views/assets/js/vendors/angular-ui-router.js:4021:23
compile/</<@http://127.0.0.1:8080/views/assets/js/vendors/angular-ui-router.js:3959:11
[email protected]://127.0.0.1:8080/views/assets/js/vendors/angular.js:18005:28
transitionTo/$state.transition<@http://127.0.0.1:8080/views/assets/js/vendors/angular-ui-router.js:3352:22
[email protected]://127.0.0.1:8080/views/assets/js/vendors/angular.js:16383:28
scheduleProcessQueue/<@http://127.0.0.1:8080/views/assets/js/vendors/angular.js:16399:27
[email protected]://127.0.0.1:8080/views/assets/js/vendors/angular.js:17682:28
[email protected]://127.0.0.1:8080/views/assets/js/vendors/angular.js:17495:31
[email protected]://127.0.0.1:8080/views/assets/js/vendors/angular.js:17790:24
[email protected]://127.0.0.1:8080/views/assets/js/vendors/angular.js:11831:47
[email protected]://127.0.0.1:8080/views/assets/js/vendors/angular.js:12033:7
[email protected]://127.0.0.1:8080/views/assets/js/vendors/angular.js:11966:9
 <div ui-view="" class="ng-scope">

I’m using electron, angularjs and sqlite to build my app but I’m stuck on this error, any help will be appreciated.

Source: New feed
Source Url Browserify / Electron / AngularJS Error: fs.existsSync is not a function