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

670
Visualizações
Problema con la dependencia de babel-jest al ejecutar npm start en una aplicación React

Todo lo que estoy haciendo es ejecutar create-react-app y cd'ing en la aplicación, luego intento ejecutar npm/yarn start . Recibo el siguiente error/salida/registro. He seguido todos los pasos sugeridos. Lo único que funciona es SKIP_PREFLIGHT_CHECK=true en mi .env como último recurso tanto para Yarn como para npm. Recientemente actualicé a Mojave y tuve que reinstalar mi Xcode si las personas han tenido una experiencia similar.

 Last login: Tue Oct 30 16:30:24 on ttys002 TheLAB11:~ jasonspiller$ cd repos/react-express-graphql-app/ TheLAB11:react-express-graphql-app jasonspiller$ npm start > react-express-graphql-app@0.1.0 start /Users/jasonspiller/repos/react-express-graphql-app > react-scripts start There might be a problem with the project dependency tree. It is likely not a bug in Create React App, but something you need to fix locally. The react-scripts package provided by Create React App requires a dependency: "babel-jest": "23.6.0" Don't try to install it manually: your package manager does it automatically. However, a different version of babel-jest was detected higher up in the tree: /Users/jasonspiller/node_modules/babel-jest (version: 23.4.2) Manually installing incompatible versions is known to cause hard-to-debug issues. If prefer to ignore this check, add SKIP_PREFLIGHT_CHECK=true to an .env file in your project. That will permanently disable this message but you might encounter other issues. To fix the dependency tree, try following the steps below in the exact order: 1. Delete package-lock.json (not package.json!) and/or yarn.lock in your project folder. 2. Delete node_modules in your project folder. 3. Remove "babel-jest" from dependencies and/or devDependencies in the package.json file in your project folder. 4. Run npm install or yarn, depending on the package manager you use. In most cases, this should be enough to fix the problem. If this has not helped, there are a few other things you can try: 5. If you used npm, install yarn (http://yarnpkg.com/) and repeat the above steps with it instead. This may help because npm has known issues with package hoisting which may get resolved in future versions. 6. Check if /Users/jasonspiller/node_modules/babel-jest is outside your project directory. For example, you might have accidentally installed something in your home folder. 7. Try running npm ls babel-jest in your project folder. This will tell you which other package (apart from the expected react-scripts) installed babel-jest. If nothing else helps, add SKIP_PREFLIGHT_CHECK=true to an .env file in your project. That would permanently disable this preflight check in case you want to proceed anyway. PS We know this message is long but please read the steps above :-) We hope you find them helpful! npm ERR! code ELIFECYCLE npm ERR! errno 1 npm ERR! react-express-graphql-app@0.1.0 start: `react-scripts start` npm ERR! Exit status 1 npm ERR! npm ERR! Failed at the react-express-graphql-app@0.1.0 start script. npm ERR! This is probably not a problem with npm. There is likely additional logging output above. npm ERR! A complete log of this run can be found in: npm ERR! /Users/jasonspiller/.npm/_logs/2018-10-30T23_09_42_358Z-debug.log
over 4 years ago · Santiago Trujillo
3 Respostas
Responde à pergunta

0

Acabo de tener el mismo problema. Por alguna razón, el paquete terminó en un directorio node_modules en mi directorio de inicio. También me dio exactamente el mismo error para el paquete jest .

No estoy seguro de la forma correcta de solucionar esto, ya que npm uninstall -g babel-jest y yarn global remove babel-jest no hacen nada.

Lo arreglé eliminando las carpetas que causan el problema: bash rm -rf ~/node_modules/babel-jest ~/node_modules/jest

Sería genial saber cómo esos paquetes terminaron allí y la forma correcta de deshacerse de ellos, pero por ahora, solo eliminar las carpetas es suficiente para que el servidor de desarrollo de CRA se ejecute sin omitir la verificación previa.

over 4 years ago · Santiago Trujillo Relatório

0

Este problema puede ocurrir si hay node_modules en un directorio principal de la carpeta donde ejecuta la aplicación. Resolví el problema eliminando el directorio node_modules.

over 4 years ago · Santiago Trujillo Relatório

0

Yo también enfrenté un problema similar y pude resolver el problema siguiendo los pasos a continuación.

  1. Cree un archivo .env en el directorio raíz de su proyecto y agregue la siguiente declaración

SKIP_PREFLIGHT_CHECK=verdadero

  1. Guarda el archivo

  2. Eliminar node_modules, yarn.lock, package.lock

  3. Luego reinstale node_modules con

instalar npm

Esto debería funcionar

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