Update to Angular v6 - Module not found: Error: Can't resolve 'fs'

前端 未结 12 2472
栀梦
栀梦 2020-11-30 06:04

I\'m trying to migrate my Angular Universal project from Angular v5 to v6

I\'ve got a service where I use fs to load the translation on the server side.

12条回答
  •  悲哀的现实
    2020-11-30 06:16

    Since previous answers are quite old, it might help to highlight here that a workaround for Angular9 is just to add the following in your package.json:

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

    This works very well for me. For reference, I found this solution on the official tensorflow/tfjs Github page here.

提交回复
热议问题