Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

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 
like image 748
Shreyas Murali Avatar asked Nov 16 '22 12:11

Shreyas Murali


1 Answers

I got it working by installing the missing modules.

npm install assert --save
npm install buffer --save

Answer from https://github.com/sindresorhus/file-type/issues/417.

like image 137
Adam Avatar answered Dec 05 '22 20:12

Adam