ibrahem
4717
8
Mix

Module not found: Error: Can't resolve 'fs'

Posted 2 years ago by ibrahem

hi, when run gulp get error not found fs module

// depend fs
let dir = require('node-dir');
//or 
let fs = require('fs');

dir.path(__dirname, function(err, paths){
    console.log(paths.dirs);
    console.log(paths.files);
    console.log(paths);
});

result

gulp
 
[01:02:59] Using gulpfile ~/ibrahem_ghaemi/laravel/gulpfile.js
[01:02:59] Starting 'all'...
[01:02:59] Starting 'webpack'...
{ [Error: ./resources/assets/js/router.js
Module not found: Error: Can't resolve 'fs' in '/Users/user/ibrahem_ghaemi/laravel/resources/assets/js'
resolve 'fs' in '/Users/user/ibrahem_ghaemi/laravel/resources/assets/js'
  Parsed request is a module
  using description file: /Users/user/ibrahem_ghaemi/laravel/package.json (relative path: ./resources/assets/js)
    Field 'browser' doesn't contain a valid alias configuration
  after using description file: /Users/user/ibrahem_ghaemi/laravel/package.json (relative path: ./resources/assets/js)
    resolve as module

Please sign in or create an account to participate in this conversation.

Reply to

Use Markdown with GitHub-flavored code blocks.