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

前端 未结 12 2465
栀梦
栀梦 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:14

    Apparently advanced-json-path resolves this issue in Angular 6 onwards if anyone is using fs

    So one has to do an

    npm i advanced-json-path --save-dev
    

    as it is a dev dependency (at least in my case) as of this message instance, it is version 1.0.8 Then the Module 'fs' not found doesn't occur.

    package.json
    {
        ....
       "advanced-json-path": "^1.0.8",
    }
    

    In our application it got rid of the Module 'fs' not found error.

提交回复
热议问题