Reactjs development server won't start on macos catalina

Viewed 1543

I am trying to create a new react.js project with create-react-app. When I execute yarn start, the development server doesn't start and the console gives me this message :

Starting the development server...

dyld: lazy symbol binding failed: Symbol not found: _FSEventStreamCreate
  Referenced from: /Users/username/project/node_modules/fsevents/build/Release/fse.node
  Expected in: flat namespace

dyld: Symbol not found: _FSEventStreamCreate
  Referenced from: /Users/username/project/node_modules/fsevents/build/Release/fse.node
  Expected in: flat namespace

error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.

That happens with the newly created react.js project, not with the older ones. I install and reinstall node.js with brew install node, I also reinstall create-react-app, but nothing happens.

Information about my environment :

  1. OS: macOS Catalina , version 10.15.4 (19E266)
  2. Node : v13.11.0
  3. create-react-app : version 3.4.1
  4. yarn : version 1.22.4
  5. npm : version 6.13.7

Thanks in advance for a perfect answer

4 Answers

Deleting the fsevents folder/folders inside. 'node_modules' worked for me on MacOS Mojave. If after deleting one fsevent directory , it still fails , then delete the fsevents folder in the current path shown in the error.

Deleted the fsevent folder inside the node_modules/webpack-dev-server worked for me.

The problem was repeated again . To solve it I just go to brew website and copy the installer code /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install.sh)" then everything works again

I was getting a similar error, not while using React but while using Phoenix and Elixir. Since this question is one of the only search results for the error message Symbol not found: _FSEventStreamCreate, I'll share my problem and my solution:

I'm using MacOS Mojave 10.14.6 and was trying to create a Phoenix app using Elixir 1.9.4 (compiled with Erlang/OTP 22), Phoenix v1.4.10. The problem was that live reloading was going haywire: my pages kept refreshing over and over even when I hadn't made any changes.

Looking in my server output I saw things like this repeated over and over:

[error] Task #PID<0.1149.0> started from RumblWeb.Endpoint terminating
** (stop) :watcher_command_error
    (phoenix) lib/phoenix/endpoint/watcher.ex:29: Phoenix.Endpoint.Watcher.watch/3
    (elixir) lib/task/supervised.ex:90: Task.Supervised.invoke_mfa/2
    (stdlib) proc_lib.erl:249: :proc_lib.init_p_do_apply/3
Function: &Phoenix.Endpoint.Watcher.watch/3
    Args: ["node", ["node_modules/webpack/bin/webpack.js", "--mode", "development", "--watch-stdin"], [cd: "/Users/george/code/phoenix/programming_phx/rumbl/assets"]]

Webpack is watching the files…

...

dyld: lazy symbol binding failed: Symbol not found: _FSEventStreamCreate
  Referenced from: /Users/george/code/phoenix/programming_phx/rumbl/assets/node_modules/fsevents/build/Release/fse.node
  Expected in: flat namespace

dyld: Symbol not found: _FSEventStreamCreate
  Referenced from: /Users/george/code/phoenix/programming_phx/rumbl/assets/node_modules/fsevents/build/Release/fse.node
  Expected in: flat namespace

I.e. webpack was getting errors, causing the page to recompile and reload, but the source of those errors was something to do with dyld and fsevents.

I don't understand what the error means, but upgrading my version of node from v12.10.0 to v13.13.0 fixed it.

(Don't forget to restart the phoenix server, and make sure that the terminal window in which mix phx.server is running is using the new, updated version of node.)

Related