React: Module not found: Can't resolve 'react-html-parser'

前端 未结 1 1048
醉话见心
醉话见心 2020-12-12 00:19

I am trying to install react-html-parser in my docker container \'client\':

docker-compose.yml
client/
      Dockerfile-dev
      node_modules/
         


        
相关标签:
1条回答
  • 2020-12-12 00:28

    When your docker-compose.yml file says:

    volumes:
      - '/usr/src/app/node_modules'
    

    You're telling Docker your node_modules directory contains critical data that needs to be persisted across container runs. The first time you launch the container it will get populated from the image, but because that directory contains critical data, Docker will never ever update it again, even if you try to npm install additional modules.

    For a near-term workaround, it's enough to docker-compose stop; docker-compose rm; docker-compose up --build your containers. Deleting the existing container (and its anonymous volume) is important.

    0 讨论(0)
提交回复
热议问题