Development server of create-react-app does not auto refresh

后端 未结 17 1457
清酒与你
清酒与你 2020-12-01 07:30

I am following a tutorial on React using create-react-app. The application is created by create-react-app v1.3.0

create-react-app my-app

T

相关标签:
17条回答
  • 2020-12-01 07:46

    I came up against this same problem when starting the server through npm run start. When I changed it to npm start, it worked as expected.

    0 讨论(0)
  • 2020-12-01 07:47

    Install Addon Classic Cache Killer on Chrome, 100% will solve the problem.

    0 讨论(0)
  • 2020-12-01 07:47

    For Linux system you can try

    sudo npm start
    
    0 讨论(0)
  • 2020-12-01 07:50

    After creating a new project using create-react-app toolchain

    Make sure to run

    1. npm install, then
    2. npm start
    0 讨论(0)
  • 2020-12-01 07:51

    Find your index.js and change something in this file, for example add a white space, then save. It should show "compiling..." in your console.

    Then you can modify other files and react will refresh on save.

    It seems that npm is looking for changes in the index.js at the very first time, if you refactor your folder structure the index.js could be missed. Force an update in index.js file get the problem solved.

    At least this has worked to me

    0 讨论(0)
  • 2020-12-01 07:53

    Try using this command

    echo fs.inotify.max_user_watches=524288 
    sudo tee -a /etc/sysctl.conf && sudo sysctl -p
    

    If still, the error is there then you need to remove your node modules and again

    npm install
    

    and then

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