Module not found: Error: Can’t resolve ‘fsevents’ in ‘/var/www/html/node_modules/chokidar/lib’

  docker, laravel-mix-vue3, node.js, npm, webpack

Help please! this is the error i’m getting whenever i try to compile my project, I’m using laravel with docker and npm 7.24.0, I’d appreciate any urgent help!

`
WARNING in ./node_modules/chokidar/lib/fsevents-handler.js 9:13-32
Module not found: Error: Can’t resolve ‘fsevents’ in ‘/var/www/html/node_modules/chokidar/lib’

WARNING in ./node_modules/cssnano/dist/index.js 57:11-22
Critical dependency: the request of a dependency is an expression

WARNING in ./node_modules/cssnano/dist/index.js 63:11-25
Critical dependency: the request of a dependency is an expression

WARNING in ./node_modules/cssnano/dist/index.js 118:39-57
Critical dependency: the request of a dependency is an expression

WARNING in ./node_modules/cssnano/dist/index.js 123:37-52
Critical dependency: the request of a dependency is an expression

WARNING in ./node_modules/import-from/index.js 4:46-91
Critical dependency: the request of a dependency is an expression

WARNING in ./node_modules/import-from/index.js 8:9-54
Critical dependency: the request of a dependency is an expression

ERROR in ./node_modules/jest-worker/build/workers/messageParent.js 19:39-64
Module not found: Error: Can’t resolve ‘worker_threads’ in ‘/var/www/html/node_modules/jest-worker/build/workers’

ERROR in ./node_modules/node-notifier/lib/checkGrowl.js 1:10-24
Module not found: Error: Can’t resolve ‘net’ in ‘/var/www/html/node_modules/node-notifier/lib’

ERROR in ./node_modules/webpack-notifier/index.js 3:9-22
Module not found: Error: Can’t resolve ‘os’ in ‘/var/www/html/node_modules/webpack-notifier’

BREAKING CHANGE: webpack < 5 used to include polyfills for node.js core modules by default.
This is no longer the case. Verify if you need this module and configure a polyfill for it.

If you want to include a polyfill, you need to:
– add a fallback ‘resolve.fallback: { "os": require.resolve("os-browserify/browser") }’
– install ‘os-browserify’
If you don’t want to include a polyfill, you can use an empty module like this:
resolve.fallback: { "os": false }

ERROR in ./node_modules/webpack/hot/lazy-compilation-node.js 12:15-38
Module not found: Error: Can’t resolve ‘http’ in ‘/var/www/html/node_modules/webpack/hot’

BREAKING CHANGE: webpack < 5 used to include polyfills for node.js core modules by default.
This is no longer the case. Verify if you need this module and configure a polyfill for it.

If you want to include a polyfill, you need to:
– add a fallback ‘resolve.fallback: { "http": require.resolve("stream-http") }’
– install ‘stream-http’
If you don’t want to include a polyfill, you can use an empty module like this:
resolve.fallback: { "http": false }

ERROR in ./node_modules/webpack/lib/hmr/lazyCompilationBackend.js 8:13-28
Module not found: Error: Can’t resolve ‘http’ in ‘/var/www/html/node_modules/webpack/lib/hmr’

BREAKING CHANGE: webpack < 5 used to include polyfills for node.js core modules by default.
This is no longer the case. Verify if you need this module and configure a polyfill for it.

If you want to include a polyfill, you need to:
– add a fallback ‘resolve.fallback: { "http": require.resolve("stream-http") }’
– install ‘stream-http’
If you don’t want to include a polyfill, you can use an empty module like this:
resolve.fallback: { "http": false }

ERROR in ./node_modules/webpack/lib/javascript/JavascriptModulesPlugin.js 9:11-24
Module not found: Error: Can’t resolve ‘vm’ in ‘/var/www/html/node_modules/webpack/lib/javascript’

BREAKING CHANGE: webpack < 5 used to include polyfills for node.js core modules by default.
This is no longer the case. Verify if you need this module and configure a polyfill for it.

If you want to include a polyfill, you need to:
– add a fallback ‘resolve.fallback: { "vm": require.resolve("vm-browserify") }’
– install ‘vm-browserify’
If you don’t want to include a polyfill, you can use an empty module like this:
resolve.fallback: { "vm": false }

ERROR in ./node_modules/webpack/lib/javascript/JavascriptParser.js 11:11-24
Module not found: Error: Can’t resolve ‘vm’ in ‘/var/www/html/node_modules/webpack/lib/javascript’

BREAKING CHANGE: webpack < 5 used to include polyfills for node.js core modules by default.
This is no longer the case. Verify if you need this module and configure a polyfill for it.

If you want to include a polyfill, you need to:
– add a fallback ‘resolve.fallback: { "vm": require.resolve("vm-browserify") }’
– install ‘vm-browserify’
If you don’t want to include a polyfill, you can use an empty module like this:
resolve.fallback: { "vm": false }

ERROR in ./node_modules/webpack/lib/schemes/HttpUriPlugin.js 10:64-79
Module not found: Error: Can’t resolve ‘zlib’ in ‘/var/www/html/node_modules/webpack/lib/schemes’

BREAKING CHANGE: webpack < 5 used to include polyfills for node.js core modules by default.
This is no longer the case. Verify if you need this module and configure a polyfill for it.

If you want to include a polyfill, you need to:
– add a fallback ‘resolve.fallback: { "zlib": require.resolve("browserify-zlib") }’
– install ‘browserify-zlib’
If you don’t want to include a polyfill, you can use an empty module like this:
resolve.fallback: { "zlib": false }

ERROR in ./node_modules/webpack/lib/schemes/HttpUriPlugin.js 19:30-45
Module not found: Error: Can’t resolve ‘http’ in ‘/var/www/html/node_modules/webpack/lib/schemes’

BREAKING CHANGE: webpack < 5 used to include polyfills for node.js core modules by default.
This is no longer the case. Verify if you need this module and configure a polyfill for it.

If you want to include a polyfill, you need to:
– add a fallback ‘resolve.fallback: { "http": require.resolve("stream-http") }’
– install ‘stream-http’
If you don’t want to include a polyfill, you can use an empty module like this:
resolve.fallback: { "http": false }

ERROR in ./node_modules/webpack/lib/schemes/HttpUriPlugin.js 20:31-47
Module not found: Error: Can’t resolve ‘https’ in ‘/var/www/html/node_modules/webpack/lib/schemes’

BREAKING CHANGE: webpack < 5 used to include polyfills for node.js core modules by default.
This is no longer the case. Verify if you need this module and configure a polyfill for it.

If you want to include a polyfill, you need to:
– add a fallback ‘resolve.fallback: { "https": require.resolve("https-browserify") }’
– install ‘https-browserify’
If you don’t want to include a polyfill, you can use an empty module like this:
resolve.fallback: { "https": false }

ERROR in ./node_modules/webpack/lib/serialization/FileMiddleware.js 8:21-38
Module not found: Error: Can’t resolve ‘stream’ in ‘/var/www/html/node_modules/webpack/lib/serialization’

BREAKING CHANGE: webpack < 5 used to include polyfills for node.js core modules by default.
This is no longer the case. Verify if you need this module and configure a polyfill for it.

If you want to include a polyfill, you need to:
– add a fallback ‘resolve.fallback: { "stream": require.resolve("stream-browserify") }’
– install ‘stream-browserify’
If you don’t want to include a polyfill, you can use an empty module like this:
resolve.fallback: { "stream": false }

ERROR in ./node_modules/webpack/lib/serialization/FileMiddleware.js 15:4-19
Module not found: Error: Can’t resolve ‘zlib’ in ‘/var/www/html/node_modules/webpack/lib/serialization’

BREAKING CHANGE: webpack < 5 used to include polyfills for node.js core modules by default.
This is no longer the case. Verify if you need this module and configure a polyfill for it.

If you want to include a polyfill, you need to:
– add a fallback ‘resolve.fallback: { "zlib": require.resolve("browserify-zlib") }’
– install ‘browserify-zlib’
If you don’t want to include a polyfill, you can use an empty module like this:
resolve.fallback: { "zlib": false }

ERROR in ./node_modules/webpack/lib/util/createHash.js 153:38-55
Module not found: Error: Can’t resolve ‘crypto’ in ‘/var/www/html/node_modules/webpack/lib/util’

BREAKING CHANGE: webpack < 5 used to include polyfills for node.js core modules by default.
This is no longer the case. Verify if you need this module and configure a polyfill for it.

If you want to include a polyfill, you need to:
– add a fallback ‘resolve.fallback: { "crypto": require.resolve("crypto-browserify") }’
– install ‘crypto-browserify’
If you don’t want to include a polyfill, you can use an empty module like this:
resolve.fallback: { "crypto": false }

ERROR in ./node_modules/yaml/browser/dist/warnings-df54cb69.js 461:19-26
Module not found: Error: Can’t resolve ‘process/browser’ in ‘/var/www/html/node_modules/yaml/browser/dist’
Did you mean ‘browser.js’?
BREAKING CHANGE: The request ‘process/browser’ failed to resolve only because it was resolved as fully specified
(probably because the origin is strict EcmaScript Module, e. g. a module with javascript mimetype, a ‘.mjs’ file, or a ‘.js’ file where the package.json contains ‘"type": "module"’).
The extension in the request is mandatory for it to be fully specified.
Add the extension to the request.`

Source: Docker Questions

LEAVE A COMMENT