3

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

First Arachne
  • 786
  • 1
  • 8
  • 18
thecassion
  • 506
  • 1
  • 7
  • 19

4 Answers4

2

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.

fah
  • 31
  • 1
  • 5
2

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

Wally Kolcz
  • 1,604
  • 3
  • 24
  • 45
  • 1
    This worked for me. MacOS Catalina 10.15.4. I basically deleted node_modules/webpack-dev-server/node_modules/fsevents and it started working. Thanks! – Simeon G May 24 '20 at 22:20
1

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

thecassion
  • 506
  • 1
  • 7
  • 19
1

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.)

GMA
  • 5,816
  • 6
  • 51
  • 80
  • Just a few days after posting this answer, I started getting the exact same error again. Turns out that a new version of Node (14.0.0) was released on April 21st. Upgrading Node again caused the error to go away again. – GMA Apr 24 '20 at 07:32
  • Argh, now the error is happening *again* and I have no idea why. See my comment on this GitHub issue: https://github.com/fsevents/fsevents/issues/313 – GMA Apr 27 '20 at 08:14
  • Update: I still haven't fixed this. I'm not sure there is a fix until the next version of `webpack-dev-server` is released; see https://github.com/fsevents/fsevents/issues/325 and https://github.com/webpack/webpack-dev-server/pull/2539. However, the workaround I've come up with for Phoenix is to comment out the part `watchers: [ node: ... ]` from config/dev.exs. This means webpack will no longer watch the files, meaning you'll need to manually compile your assets every time you make a change - but it's the only way I've found for now to get around this frustrating issue. – GMA May 10 '20 at 08:37
  • I ran out of space in my previous comment, but just to add: to manually compile your assets on Phoenix you can run `cd assets && node node_modules/webpack/bin/webpack.js --mode development`. – GMA May 10 '20 at 08:38