React Native Fast Refresh Not Working Without sudo npm start

690 views Asked by At

My react native project cannot use React Native fast refresh feature without sudo npm start

If i just run npm start ios simulator cannot update when i save js file from vscode.

How can i solve this issue? Packager does not respond without hard reload (cmd + r)

output of watchman watch-list

{
    "version": "4.9.0",
    "roots": [
        "/path/to/project-root",
        
    ]
}

package versions:

  • npm : 6.14.9
  • "react": "16.13.1",
  • "react-native": "0.63.4",

What did i try?

  • i uninstalled watchman, install again,
  • clear npm cache, watchman cache, metro bundler cache 50 times.
  • remove ./git/index.lock
  • remove node_modules & install again
  • remove whole project from computer and clone from git
  • give full file access to watchman from macos settings
  • sudo chown -R $(whoami) /usr/bin/npm
  • sudo chown -R $(whoami) /usr/bin/node
  • sudo chown -R $(whoami) /usr/lib/node_modules/
  • sudo chown -R $(whoami /usr/local
  • create clean react native project and try on that

none of them worked for me. But if i run sudo npm start then npm run-ios, it works. But what did happen why npm stopped working without sudo

I did not change anything.

watchman --server-encoding=json --persistent log-level debug

with this command i can confirm watchman is working for my project. When i change a file and save, it's logging.

Also i tried yarn run ios

0

There are 0 answers