Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Webpack - Error: Cannot find module 'node:assert'

Webpack - Error: Cannot find module 'node:assert'

I tried adding "assert" npm package no luck, any one have any ideas on what is throwing the error?

like image 974
Eric Hasselbring Avatar asked Jul 09 '26 00:07

Eric Hasselbring


2 Answers

Please update node.js to latest versions and that should fix the issue for NX projects

like image 71
Rushit Vora Avatar answered Jul 13 '26 18:07

Rushit Vora


Another thing is if you are using typescript like me, then:

npm i @types/node

And make sure the the tsconfig.json doesn't have a custom typeRoots property that ignores the default types in the node_modules folder

like image 45
Chen Peleg Avatar answered Jul 13 '26 19:07

Chen Peleg



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!