2

After I updated my angular project from 12 to 13 version I got a lot of module errors when I ran ng serve --o. How I can fix it?

 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: { "util": require.resolve("util/") }'
        - install 'util'
If you don't want to include a polyfill, you can use an empty module like this:
        resolve.fallback: { "util": false }

./node_modules/cacache/lib/util/tmp.js:6:13-28 - Error: Module not found: Error: Can't resolve 'path' in 'D:\StudenBook\node_modules\cacache\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: { "path": require.resolve("path-browserify") }'
        - install 'path-browserify'
If you don't want to include a polyfill, you can use an empty module like this:
        resolve.fallback: { "path": false }

./node_modules/cacache/lib/verify.js:3:13-28 - Error: Module not found: Error: Can't resolve 'util' in 'D:\StudenBook\node_modules\cacache\lib'

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: { "util": require.resolve("util/") }'
        - install 'util'
If you don't want to include a polyfill, you can use an empty module like this:
        resolve.fallback: { "util": false }

./node_modules/cacache/lib/verify.js:8:11-24 - Error: Module not found: Error: Can't resolve 'fs' in 'D:\StudenBook\node_modules\cacache\lib'

./node_modules/cacache/lib/verify.js:12:13-28 - Error: Module not found: Error: Can't resolve 'path' in 'D:\StudenBook\node_modules\cacache\lib'

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: { "path": require.resolve("path-browserify") }'
        - install 'path-browserify'
If you don't want to include a polyfill, you can use an empty module like this:
        resolve.fallback: { "path": false }

./node_modules/cacache/rm.js:3:13-28 - Error: Module not found: Error: Can't resolve 'util' in 'D:\StudenBook\node_modules\cacache'

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: { "util": require.resolve("util/") }'
        - install 'util'
If you don't want to include a polyfill, you can use an empty module like this:
        resolve.fallback: { "util": false }

./node_modules/cacache/rm.js:7:13-28 - Error: Module not found: Error: Can't resolve 'path' in 'D:\StudenBook\node_modules\cacache'

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: { "path": require.resolve("path-browserify") }'
        - install 'path-browserify'
If you don't want to include a polyfill, you can use an empty module like this:
        resolve.fallback: { "path": false }

./node_modules/chownr/chownr.js:2:11-24 - Error: Module not found: Error: Can't resolve 'fs' in 'D:\StudenBook\node_modules\chownr'

./node_modules/chownr/chownr.js:3:13-28 - Error: Module not found: Error: Can't resolve 'path' in 'D:\StudenBook\node_modules\chownr'

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: { "path": require.resolve("path-browserify") }'
        - install 'path-browserify'
If you don't want to include a polyfill, you can use an empty module like this:
        resolve.fallback: { "path": false }

./node_modules/detect-libc/lib/detect-libc.js:3:15-37 - Error: Module not found: Error: Can't resolve 'os' in 'D:\StudenBook\node_modules\detect-libc\lib'

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 }

./node_modules/detect-libc/lib/detect-libc.js:4:16-50 - Error: Module not found: Error: Can't resolve 'child_process' in 'D:\StudenBook\node_modules\detect-libc\lib'

./node_modules/detect-libc/lib/detect-libc.js:5:18-43 - Error: Module not found: Error: Can't resolve 'fs' in 'D:\StudenBook\node_modules\detect-libc\lib'

./node_modules/fs-minipass/index.js:4:11-24 - Error: Module not found: Error: Can't resolve 'fs' in 'D:\StudenBook\node_modules\fs-minipass'

./node_modules/fs.realpath/index.js:8:9-22 - Error: Module not found: Error: Can't resolve 'fs' in 'D:\StudenBook\node_modules\fs.realpath'

./node_modules/fs.realpath/old.js:22:17-32 - Error: Module not found: Error: Can't resolve 'path' in 'D:\StudenBook\node_modules\fs.realpath'

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: { "path": require.resolve("path-browserify") }'
        - install 'path-browserify'
If you don't want to include a polyfill, you can use an empty module like this:
        resolve.fallback: { "path": false }

./node_modules/fs.realpath/old.js:24:9-22 - Error: Module not found: Error: Can't resolve 'fs' in 'D:\StudenBook\node_modules\fs.realpath'

./node_modules/gauge/lib/error.js:2:11-26 - Error: Module not found: Error: Can't resolve 'util' in 'D:\StudenBook\node_modules\gauge\lib'

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: { "util": require.resolve("util/") }'
        - install 'util'
If you don't want to include a polyfill, you can use an empty module like this:
        resolve.fallback: { "util": false }

./node_modules/glob/common.js:13:11-26 - Error: Module not found: Error: Can't resolve 'path' in 'D:\StudenBook\node_modules\glob'

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: { "path": require.resolve("path-browserify") }'
        - install 'path-browserify'
If you don't want to include a polyfill, you can use an empty module like this:
        resolve.fallback: { "path": false }

./node_modules/glob/glob.js:43:9-22 - Error: Module not found: Error: Can't resolve 'fs' in 'D:\StudenBook\node_modules\glob'

./node_modules/glob/glob.js:49:11-26 - Error: Module not found: Error: Can't resolve 'path' in 'D:\StudenBook\node_modules\glob'

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: { "path": require.resolve("path-browserify") }'
        - install 'path-browserify'
If you don't want to include a polyfill, you can use an empty module like this:
        resolve.fallback: { "path": false }

./node_modules/glob/glob.js:50:13-30 - Error: Module not found: Error: Can't resolve 'assert' in 'D:\StudenBook\node_modules\glob'

And more others module errors... Please help me

2
  • Read the error messages, then search for the error message on your favorite search engine, discover that this is something others have seen before, then do something to correct the problem. Basics of troubleshooting, really. stackoverflow.com/questions/64402821/… Commented Dec 19, 2021 at 16:32
  • So, I found out my problem; All of troubleshooting was cuz of bcrypt module, I deleted it. I installed it previous. Don't know why its caused so many troubles Commented Dec 19, 2021 at 19:01

1 Answer 1

1

you may need to use npm install to install all your lost modules

for example for your util module error, use this command to reinstall it again:

npm i util

Sign up to request clarification or add additional context in comments.

4 Comments

So, I can't install all of them in the same time?
use this command: npm i --force
i tried, but nothig. I'll try to install every module separately
I hope it works

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.