A silly question, but did you run npm install?
Jan 29, 2018
2
Level 14
require('js') returns empty object
I'm working with some of the node.js functionalities within Laravel, namely using laravel-mix, and I'm encountering a problem with my source code.
For whatever reason, require('fs') is returning an empty object, essentially preventing me from using the module.
I've already tried adding fs: 'empty' to my webpack configuration:
let mix = require('laravel-mix');
mix.webpackConfig({
node: {
fs: 'empty'
}
});
mix.js('resources/assets/js/app.js', 'public/js')
.sass('resources/assets/sass/app.scss', 'public/css')
.sourceMaps();
Which didn't solve the problem.
I'm using Windows 10 right now, and I tried running it on Windows 7 this morning. Neither of which worked.
Is there something I'm doing wrong?
Please or to participate in this conversation.