Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

436
Visualizações
Testing with Jest failed with Error: Error watching file for changes: EMFILE

I tried to write a test for a React.js app. Everything was going fine but after making the directory tracked with Git(made a Git repo with it). The test fails with the error below

2017-01-15 05:05 node[1278] (FSEvents.framework) FSEventStreamStart: register_with_server: ERROR: f2d_register_rpc() => (null) (-22)
2017-01-15 05:05 node[1278] (FSEvents.framework) FSEventStreamStart: register_with_server: ERROR: f2d_register_rpc() => (null) (-22)
events.js:160
      throw er; // Unhandled 'error' event
      ^

Error: Error watching file for changes: EMFILE
    at exports._errnoException (util.js:1022:11)
    at FSEvent.FSWatcher._handle.onchange (fs.js:1406:11)

I am sure that this is because of .git directory because when I remove .git directory it is running without the error. It seems that the exception occurs in watching the files. My development environment is MacOS 10.12.2 and Node 6.9.4. How can I resolve this issue?

over 4 years ago · Santiago Trujillo
3 Respostas
Responde à pergunta

0

Oh, I am going to answer my question after hours of my struggling.
The best solution is to install the latest version of Watchman.
The old version of Watchman causes fsevents module throws the exception.

After installing watchman, optionally you can run sudo chown -R $(whoami):staff ~/Library/LaunchAgents to give the permission.

over 4 years ago · Santiago Trujillo Relatório

0

I have ran into the same problem and upgrade watchman didn't fix this for me. Reading the documentation of Jest, you will find there is an option to disable using watchman. So I guess watchman is not necessary.

What fixed this for me is to upgrade Jest to the lastest version using npm install --save-dev jest@latest.

over 4 years ago · Santiago Trujillo Relatório

0

Do you have watchman installed? I recently had a colleague spill water in my laptop, so after migrating projects etc to a new laptop I had a similar issue. I realised after a bit of head-scratching that i just needed to run brew install watchman, assuming that you have homebrew of course.

over 4 years ago · Santiago Trujillo Relatório
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda