1

Los comandos que usé son los siguientes, luego de seleccionar una carpeta vacia: npx create-react-app esto me devuelve (pareceria que se ejecuta bien):

Creating a new React app in /home/maia/Documentos/Proyectos/React-Mircha/my-app.

Installing packages. This might take a couple of minutes.
Installing react, react-dom, and react-scripts with cra-template...

yarn add v1.22.5
[1/4] Resolving packages...
[2/4] Fetching packages...
info [email protected]: The platform "linux" is incompatible with this module.
info "[email protected]" is an optional dependency and failed compatibility check. Excluding it from installation.
info [email protected]: The platform "linux" is incompatible with this module.
info "[email protected]" is an optional dependency and failed compatibility check. Excluding it from installation.
[3/4] Linking dependencies...
warning "react-scripts > @typescript-eslint/eslint-plugin > [email protected]" has unmet peer dependency "typescript@>=2.8.0 || >= 3.2.0-dev || >= 3.3.0-dev || >= 3.4.0-dev || >= 3.5.0-dev || >= 3.6.0-dev || >= 3.6.0-beta || >= 3.7.0-dev || >= 3.7.0-beta".
[4/4] Building fresh packages...
success Saved lockfile.
success Saved 7 new dependencies.
info Direct dependencies
├─ [email protected]
├─ [email protected]
├─ [email protected]
└─ [email protected]
info All dependencies
├─ [email protected]
├─ [email protected]
├─ [email protected]
├─ [email protected]
├─ [email protected]
├─ [email protected]
└─ [email protected]
Done in 28.29s.

Initialized a git repository.

Installing template dependencies using yarnpkg...
yarn add v1.22.5
[1/4] Resolving packages...
[2/4] Fetching packages...
info [email protected]: The platform "linux" is incompatible with this module.
info "[email protected]" is an optional dependency and failed compatibility check. Excluding it from installation.
info [email protected]: The platform "linux" is incompatible with this module.
info "[email protected]" is an optional dependency and failed compatibility check. Excluding it from installation.
[3/4] Linking dependencies...
warning "react-scripts > @typescript-eslint/eslint-plugin > [email protected]" has unmet peer dependency "typescript@>=2.8.0 || >= 3.2.0-dev || >= 3.3.0-dev || >= 3.4.0-dev || >= 3.5.0-dev || >= 3.6.0-dev || >= 3.6.0-beta || >= 3.7.0-dev || >= 3.7.0-beta".
warning " > @testing-library/[email protected]" has unmet peer dependency "@testing-library/dom@>=7.21.4".
[4/4] Building fresh packages...
success Saved lockfile.
success Saved 17 new dependencies.
info Direct dependencies
├─ @testing-library/[email protected]
├─ @testing-library/[email protected]
├─ @testing-library/[email protected]
├─ [email protected]
├─ [email protected]
└─ [email protected]
info All dependencies
├─ @testing-library/[email protected]
├─ @testing-library/[email protected]
├─ @testing-library/[email protected]
├─ @testing-library/[email protected]
├─ @types/[email protected]
├─ @types/[email protected]
├─ @types/[email protected]
├─ [email protected]
├─ [email protected]
├─ [email protected]
├─ [email protected]
├─ [email protected]
├─ [email protected]
├─ [email protected]
├─ [email protected]
├─ [email protected]
└─ [email protected]
Done in 7.43s.
Removing template package using yarnpkg...

yarn remove v1.22.5
[1/2] Removing module cra-template...
[2/2] Regenerating lockfile and installing missing dependencies...
info [email protected]: The platform "linux" is incompatible with this module.
info "[email protected]" is an optional dependency and failed compatibility check. Excluding it from installation.
info [email protected]: The platform "linux" is incompatible with this module.
info "[email protected]" is an optional dependency and failed compatibility check. Excluding it from installation.
warning " > @testing-library/[email protected]" has unmet peer dependency "@testing-library/dom@>=7.21.4".
warning "react-scripts > @typescript-eslint/eslint-plugin > [email protected]" has unmet peer dependency "typescript@>=2.8.0 || >= 3.2.0-dev || >= 3.3.0-dev || >= 3.4.0-dev || >= 3.5.0-dev || >= 3.6.0-dev || >= 3.6.0-beta || >= 3.7.0-dev || >= 3.7.0-beta".
success Uninstalled packages.
Done in 5.19s.

Created git commit.

Success! Created my-app at /home/maia/Documentos/Proyectos/React-Mircha/my-app Inside that directory, you can run several commands:

yarn start Starts the development server.

yarn build Bundles the app into static files for production.

yarn test Starts the test runner.

yarn eject Removes this tool and copies build dependencies, configuration files and scripts into the app directory. If you do this, you can’t go back!

We suggest that you begin by typing:

cd my-app yarn start

Happy hacking!

PERO.... al darle npm start, aquí ocurre el error :( (en las carpetas que me devuelve el anterior comando falta la de package-lock.json

npm ERR! code ENOENT
npm ERR! syscall open
npm ERR! path /home/maia/Documentos/Proyectos/React-Mircha/package.json
npm ERR! errno -2
npm ERR! enoent ENOENT: no such file or directory, open '/home/maia/Documentos/Proyectos/React-Mircha/package.json'
npm ERR! enoent This is related to npm not being able to find a file.
npm ERR! enoent 

npm ERR! A complete log of this run can be found in:
npm ERR!     /home/maia/.npm/_logs/2021-05-01T18_34_12_113Z-debug.log

Ya eliminé node y lo descargué de nuevo y probé varias cosas pero no encuentro cómo solucionar este error. No entiendo por qué me dice "no such file or directory" . . . ¡¡¡Cualquier ayuda super agradecida!!!

13
  • 1
    Si, funciono, pero no entiendo por que me ocurre eso. Repeti los mismos pasos en otra carpeta nueva, y me ocurre exactamente lo mismo, no se crea el package lock json, tendre que hacer esto en cada proyecto?, no se si le faltara alguna configuracion a mi terminal de linux, ya no se...
    – Maia
    el 1 may. 2021 a las 18:57
  • 1
    Lo que no entiendo es porqué todo el proceso de instalación usa yarn pero tú usas npm para iniciar el proyecto. Digo, a final de cuentas usan en mismo package.json pero a lo mejor podría ser parte del problema. el 1 may. 2021 a las 20:50
  • 1
    @ricardo-dlc, tienes razon, no lo habia notado, yarn, es otro manejador de paquetes, por lo que si usas yarn, debes hacer yarn add, y despues yarn start, no puedes combinar yarn y npm ya que generara conflicto.
    – Jamt0
    el 1 may. 2021 a las 21:42
  • 1
    @Jamt0 tendrìa que hacer algo como la primera respuesta de esta pregunta? stackoverflow.com/questions/59451813/… disculpa tantas consultas, es que he instalado / desinstalado npm, react, node, tantas veces que ya estoy un poco perdida, gracias <3
    – Maia
    el 1 may. 2021 a las 22:02
  • 1
    @ricardo-dlc gracias Ricardo por tu respuesta! Lo que hice ahora es borrar yarn, y volver a instalar nvm y ahora SÌ me instala todos los paquetes al enviar "npx create-react-app proyecto" (que serìan estos: node_modules, public, src, package.json, package-lock.json, readme.md) PERO cuando pongo "npm start" me da: ENOENT: no such file or directory, open '/home/maia/Documentos/Proyectos/Test2/package.json' npm ERR! enoent This is related to npm not being able to find a file..... :( :( por lo menos pude eliminar yarn
    – Maia
    el 1 may. 2021 a las 23:46

1 respuesta 1

1

Al parecer tu proceso de instalación usa yarn, por lo que para iniciar tu app, despues de ser creada tendrias que utilizar

yarn start

yarn y npm ambos son gestores de dependencias de javascript, pero si usas yarn para instalar debes utilizar yarn para start el proyecto.

La manera de hacer que no instale por yarn que conozco es desintalando la herramienta, de espe moto se instala por npm y se puede hacer:

npm start

Ademas se debe tener insalada la dependencia create-ract-app globarmente, en linux:

sudo npm install -g create-react-app
6
  • Despues de usar el comando npx create-react-app probando (en una carpeta nueva) y luego yarn start, me tira el siguiente error: error Couldn't find a package.json file in "/home/maia/Documentos/Proyectos/Test-yar" ... con lo cual lo que me queda por hacer seria desinstalar yarn?
    – Maia
    el 1 may. 2021 a las 22:09
  • 1
    podrias intentar desinstalar yarn, asi el create-ract-app utilizaria npm, no se exactamnete a que se debe este comportamiento
    – Jamt0
    el 1 may. 2021 a las 22:14
  • 1
    instalaste create-react-app globalmente y con sudo?
    – Jamt0
    el 1 may. 2021 a las 23:49
  • 1
    ahora SÌIIIIIIII, hace 2 dias que estoy con esto, no se como agradecerte jajaja gracias en todos los idiomas por la paciencia <3 <3 <3 <3
    – Maia
    el 1 may. 2021 a las 23:57
  • 1
    Dale, perfecto, me puedes agradecer dandome puntuación positiva, y dando la respuesta como solucion jejeje
    – Jamt0
    el 2 may. 2021 a las 0:04

Tu Respuesta

By clicking “Publica tu respuesta”, you agree to our terms of service and acknowledge you have read our privacy policy.

¿No es la respuesta que buscas? Examina otras preguntas con la etiqueta o formula tu propia pregunta.