0

Tengo un problema al intentar instalar React Navigation, estoy siguiendo la documentación pero me salen unos errores. Estoy usando expo-cli.

Primero "npm install @react-navigation/native" y me sale esto: introducir la descripción de la imagen aquí

npm notice created a lockfile as package-lock.json. You should commit this file.
npm WARN notsup Unsupported engine for [email protected]: wanted: {"node":"^10 || ^12 || >=13.7"} (current: {"node":"13.6.0","npm":"6.14.5"})
npm WARN notsup Not compatible with your version of node/npm: [email protected]
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@^1.2.7 (node_modules\jest-haste-map\node_modules\fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for [email protected]: wanted {"os":"darwin","arch":"any"} (current: {"os":"win32","arch":"x64"})
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@^1.2.7 (node_modules\jest-haste-map\node_modules\fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for [email protected]: wanted {"os":"darwin","arch":"any"} (current: {"os":"win32","arch":"x64"})
npm WARN @react-navigation/[email protected] requires a peer of react-native@* but none is installed. You must install peer dependencies yourself.
npm WARN [email protected] requires a peer of react-native@* but none is installed. You must install peer dependencies yourself.
npm WARN @unimodules/[email protected] requires a peer of react-native@* but none is installed. You must install peer dependencies yourself.
npm WARN [email protected] requires a peer of react-native@* but none is installed. You must install peer dependencies yourself.
npm WARN [email protected] requires a peer of react-native@* but none is installed. You must install peer dependencies yourself.
npm WARN [email protected] requires a peer of react-native@* but none is installed. You must install peer dependencies yourself.

Luego "expo install react-native-gesture-handler react-native-reanimated react-native-screens react-native-safe-area-context @react-native-community/masked-view" y me da este error: introducir la descripción de la imagen aquí

Installing 5 SDK 37.0.0 compatible native modules using Yarn.
> yarn add react-native-gesture-handler@~1.6.0 react-native-reanimated@~1.7.0 react-native-screens@~2.2.0 [email protected] @react-native-community/[email protected]
yarn add v1.22.4
warning package-lock.json found. Your project contains lock files generated by tools other than Yarn. It is advised not to mix package managers in order to avoid resolution inconsistencies caused by unsynchronized lock files. To clear this warning, remove package-lock.json.
[1/4] Resolving packages...
[2/4] Fetching packages...
error [email protected]: The engine "node" is incompatible with this module. Expected version "^10 || ^12 || >=13.7". Got "13.6.0"
info Visit https://yarnpkg.com/en/docs/cli/add for documentation about this command.
error Found incompatible module.
yarnpkg exited with non-zero code: 1
Error: yarnpkg exited with non-zero code: 1
    at ChildProcess.completionListener (C:\Users\Usuario\AppData\Roaming\npm\node_modules\expo-cli\node_modules\@expo\spawn-async\src\spawnAsync.ts:65:13)
    at Object.onceWrapper (events.js:428:26)
    at ChildProcess.emit (events.js:321:20)
    at ChildProcess.cp.emit (C:\Users\Usuario\AppData\Roaming\npm\node_modules\expo-cli\node_modules\cross-spawn\lib\enoent.js:34:29)
    at maybeClose (internal/child_process.js:1028:16)
    at Process.ChildProcess._handle.onexit (internal/child_process.js:286:5)
    ...
    at Object.spawnAsync [as default] (C:\Users\Usuario\AppData\Roaming\npm\node_modules\expo-cli\node_modules\@expo\spawn-async\src\spawnAsync.ts:26:19)
    at YarnPackageManager._runAsync (C:\Users\Usuario\AppData\Roaming\npm\node_modules\expo-cli\node_modules\@expo\package-manager\src\NodePackageManagers.ts:279:31)
    at YarnPackageManager.addAsync (C:\Users\Usuario\AppData\Roaming\npm\node_modules\expo-cli\node_modules\@expo\package-manager\src\NodePackageManagers.ts:236:16)
    at installAsync (C:\Users\Usuario\AppData\Roaming\npm\node_modules\expo-cli\src\commands\install.ts:72:3)
    at Command.<anonymous> (C:\Users\Usuario\AppData\Roaming\npm\node_modules\expo-cli\src\exp.ts:80:7)
2
  • 1
    Procura agregar el error como texto, no como imagen, para que sea más sencillo de leer y se te pueda ayudar. Gracias.
    – VRoxa
    Commented el 30 may. 2020 a las 22:39
  • Tu versión de node.js está desactualizada. Intenta descargarte la última versión. Commented el 11 ago. 2020 a las 16:59

1 respuesta 1

1

Yo lo hice así y me funciona.

LIBRERIA PARA NAVEGAR ENTRE PAGINAS:

npm install @react-navigation/native

expo install react-native-gesture-handler react-native-reanimated react-native-screens react-native-safe-area-context @react-native-community/masked-view

npm install @react-navigation/stack

La primera línea de código debe ser:

import 'react-native-gesture-handler'

Lo que veo es que te aparece npm y yarm. Yo usaría uno u otro, pero si usas los dos deben tener diferentes ficheros .lock

Saludos

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.