Can't resolve 'buffer' in 'C:\Portal\\node_modules\string_decoder\node_modules\safe-buffer'

Viewed 13607

I am trying to build my angular project and getting below error:

Build Command: node --max_old_space_size=8192 node_modules/@angular/cli/bin/ng build --prod

My Angular version is :@angular/cli: "^8.2.2".

I tried reinstalling nodejs 12.13 and deleted npm-cache and still it did not work

Error:-

ERROR in ./node_modules/string_decoder/node_modules/safe-buffer/index.js
Module not found: Error: Can't resolve 'buffer' in 
2 Answers
"browser": {
    "buffer": false
}

in your package.json should do the trick.

Related