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?
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?
Please update node.js to latest versions and that should fix the issue for NX projects
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
It occurs when you have an old Node version on your system and a new package is being used in your project, and you receive this error during the compilation process.
Below Solution works for me:
Step: 1 - Uninstall nodejs older version
Step: 2 - Install new version of nodejs. (https://nodejs.org/en/download)
Step: 3 - Remove node_module from the current project
Step: 4 - Run
npm i
and re-compile your project again
Before:
After:
I had the same issue on my macOS Monterey (Apple M1), I tried updating node, using npm & homebrew
Resolved by running "nvm install node" within intellij's terminal in the project directory.
rm -rf node_modules
rm package-lock.json
npm cache clean --force
npm install
I use the above command, it was really helpful
© 2022 - 2024 — McMap. All rights reserved.