Module not found: Error: Can’t resolve ‘fs’ error

The error is because of angular-cli does not support modules in node like “fs” and “path”. (Issue)

Add the following to the root of the “package.json” file.

"browser": {
  "fs": false,
  "path": false,
  "os": false

Angular apps such as the ones Angular CLI creates are browser apps. fs
isn’t available on the browser, it’s only available on node apps.


Leave a Comment