Skip to content

Instantly share code, notes, and snippets.

@mrcodedev
Last active September 28, 2024 06:02
Show Gist options
  • Save mrcodedev/37b463ae63c0c1d762e6efaf4c26af4f to your computer and use it in GitHub Desktop.
Save mrcodedev/37b463ae63c0c1d762e6efaf4c26af4f to your computer and use it in GitHub Desktop.
Como instalar Expo (React Native)

Instalación Expo para React Native

Instalando Expo

Primero instalamos con npm explo-cli y exp (debemos de tener Node.js y npm instalados)

npm install -g expo-cli exp

Después creamos nuestra zona de trabajo, le decimos como se quiere llamar la carpeta:

expo init nombreApp

Una vez que tengamos la carpeta nos metemos dentro:

cd nombreApp

Una vez dentro ya arrancamos Expo:

expo start

Ya podremos utilizar un emulador de Android o iOS o con la app de Expo ver la app en el móvil

@mrcodedev
Copy link
Author

Parece que tienes un error de conexión, te está dando un timeout :\

@Estebanpz
Copy link

Estebanpz commented May 11, 2021

Alguien sabe porque a el momento de estar en desarrollo me falla la compilación. Me aparece el siguiente error

Failed building JavaScript bundle.
Cannot read property 'reduce' of undefined

Failed building JavaScript bundle. Cannot read property 'reduce' of undefined

Y tambien este mensaje de alerta
Your project is in SDK version >= 33.0.0, but the expo package version seems to be older.

@germanmauro
Copy link

germanmauro commented Jul 7, 2021

Buenas noches!

Después de instalar expo trato de crear un proyecto y me tirá un error.

C:\React>expo init lista-app
"G\AppData\Roaming\npm" no se reconoce como un comando interno o externo,
programa o archivo por lotes ejecutable.
internal/modules/cjs/loader.js:968
throw err;
^

Error: Cannot find module 'C:\Users\M\node_modules\expo-cli\bin\expo.js'
�[90m at Function.Module._resolveFilename (internal/modules/cjs/loader.js:965:15)�[39m
�[90m at Function.Module._load (internal/modules/cjs/loader.js:841:27)�[39m
�[90m at Function.executeUserEntryPoint [as runMain] (internal/modules/run_main.js:71:12)�[39m
�[90m at internal/main/run_main_module.js:17:47�[39m {
code: �[32m'MODULE_NOT_FOUND'�[39m,
requireStack: []

@mrcodedev
Copy link
Author

@Estebanpz aunque sea tarde, creo que el problema está en el builder, estás usando por ejemplo reducers y no lo entiende.

@mrcodedev
Copy link
Author

@germanmauro no sé si lo que te dice es que tienes problemas con npm, mira que esté bien instalado o el propio expo no está bien estalado, ya que no encuentra el comando.

@germanmauro
Copy link

germanmauro commented Jul 7, 2021

@mrcodedev Si, acabo de instalar expo npm install -g expo-cli exp, tambien actualice npm

@mrcodedev
Copy link
Author

Si escribes: expo whoami Te funciona esto???. De todas maneras esto lo escribí hace bastante, la docu oficial actual es esta: https://docs.expo.io/get-started/installation/

@germanmauro
Copy link

@mrcodedev No, tampoco funciona

@mrcodedev
Copy link
Author

@JesusHernandez1995
Copy link

JesusHernandez1995 commented Sep 8, 2021

Hola, una pregunta.

Cada vez que quiera crear un proyecto nuevo en React Native, tengo que ejecutar este comando: npm install -g expo-cli exp ?
¿No basta con hacerlo la primera vez?
Gracias

@mrcodedev
Copy link
Author

Hola, una pregunta.

Cada vez que quiera crear un proyecto nuevo en React Native, tengo que ejecutar este comando: npm install -g expo-cli exp ? ¿No basta con hacerlo la primera vez? Gracias

En teoría sólo debería ser la primera vez ya que lo instalas como dependencia global y ya está :\

@mrcodedev
Copy link
Author

odio expo

Yo cuando estaba con él también, a una mala mírate Capacitor, por si te gusta más el desarrollo con esa herramienta.

@matiassrusso
Copy link

Me tira el siguiente error al intentar iniciar. Osea, instala bien, pero a su vez no. No me deja iniciar, ni chequear la version ni hacer nada:

expo : El término 'expo' no se reconoce como nombre de un cmdlet, función, archivo de script o programa ejecutable. Compruebe si escribió correctamente el nombre o, si incluyó una ruta de acceso, compruebe que dicha ruta es correcta e inténtelo de nuevo.
En línea: 1 Carácter: 1

  • expo start
  •   + CategoryInfo          : ObjectNotFound: (expo:String) [], CommandNotFoundException
      + FullyQualifiedErrorId : CommandNotFoundException
    

@ignacioborraz
Copy link

Tuve el mismo error ### ruxxit0
instale expo, limpié caché vaaarias veces y sigue sin reconocerlo... no me funciona ni siquiera expo -v

@cadmojose
Copy link

PS C:\Users\Cadmo Antunes> expo init MEON
expo : O arquivo C:\Users\Cadmo Antunes\AppData\Roaming\npm\expo.ps1 não pode ser carregado porque a execução de scripts foi desabilitada neste sistema. Para obter mais
informações, consulte about_Execution_Policies em https://go.microsoft.com/fwlink/?LinkID=135170.
No linha:1 caractere:1

  • expo init MEON
  •   + CategoryInfo          : ErrodeSegurança: (:) [], PSSecurityException
    

PS C:\Users\Cadmo Antunes> node --version
v18.12.1
PS C:\Users\Cadmo Antunes> expo init my-projeto
expo : O arquivo C:\Users\Cadmo Antunes\AppData\Roaming\npm\expo.ps1 não pode ser carregado porque a execução de scripts foi desabilitada neste sistema. Para obter mais
informações, consulte about_Execution_Policies em https://go.microsoft.com/fwlink/?LinkID=135170.
No linha:1 caractere:1

  • expo init my-projeto
    • CategoryInfo : ErrodeSegurança: (:) [], PSSecurityException
    • FullyQualifiedErrorId : UnauthorizedAccess
      PS C:\Users\Cadmo Antunes> expo --version
      expo : O arquivo C:\Users\Cadmo Antunes\AppData\Roaming\npm\expo.ps1 não pode ser carregado porque a execução de scripts foi desabilitada neste sistema. Para obter mais ra obter mais
      informações, consulte about_Execution_Policies em https://go.microsoft.com/fwlink/?LinkID=135170.
      No linha:1 caractere:1
  • expo --version
  •   + CategoryInfo          : ErrodeSegurança: (:) [], PSSecurityException
      + FullyQualifiedErrorId : UnauthorizedAccess
    
    
    
    

alguem sab q erro e este. instalei o expo mais parece q não deu certo

@IgnacioBarocchi
Copy link

IgnacioBarocchi commented Feb 20, 2023

**Edit:
Lo solucioné instalando la última versión de node con nvm, después actualicé npm. Eliminé reinstalé node modules en el proyecto.

nvm install 19.6.1 && nvm use 19.6.1 && npm install -g npm@latest

en el proyecto

rm -r node_modules && npm install**

Hola! tengo un problema que solo me ocurre en Ubuntu (20.04.5 LTS). Al hacer npm start el linter encuentra un error de sintaxis en módulo de expo, algo que no me ocurre cuando trabajo el repo en windows.
Este es el error:

<APP_NAME>@1.0.0 start /home/<USER_NAME>/Documents/projects/<APP_NAME>
expo start

(node:10592) UnhandledPromiseRejectionWarning: /home/<USER_NAME>/Documents/projects/<APP_NAME>/node_modules/@expo/cli/build/src/api/rest/client.js:26
    name = "ApiV2Error";
         ^

SyntaxError: Unexpected token =
    at Module._compile (internal/modules/cjs/loader.js:723:23)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:789:10)
    at Module.load (internal/modules/cjs/loader.js:653:32)
    at tryModuleLoad (internal/modules/cjs/loader.js:593:12)
    at Function.Module._load (internal/modules/cjs/loader.js:585:3)
    at Module.require (internal/modules/cjs/loader.js:692:17)
    at require (internal/modules/cjs/helpers.js:25:18)
    at Object.<anonymous> (/home/<USER_NAME>/Documents/projects/<APP_NAME>/node_modules/@expo/cli/build/src/api/getExpoGoIntermediateCertificate.js:7:15)
    at Module._compile (internal/modules/cjs/loader.js:778:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:789:10)
(node:10592) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 1)
(node:10592) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.
(node:10592) UnhandledPromiseRejectionWarning: /home/<USER_NAME>/Documents/projects/<APP_NAME>/node_modules/@expo/cli/build/src/api/rest/client.js:26
    name = "ApiV2Error";
         ^

SyntaxError: Unexpected token =
    at Module._compile (internal/modules/cjs/loader.js:723:23)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:789:10)
    at Module.load (internal/modules/cjs/loader.js:653:32)
    at tryModuleLoad (internal/modules/cjs/loader.js:593:12)
    at Function.Module._load (internal/modules/cjs/loader.js:585:3)
    at Module.require (internal/modules/cjs/loader.js:692:17)
    at require (internal/modules/cjs/helpers.js:25:18)
    at Object.<anonymous> (/home/<USER_NAME>/Documents/projects/<APP_NAME>/node_modules/@expo/cli/build/src/api/getExpoGoIntermediateCertificate.js:7:15)
    at Module._compile (internal/modules/cjs/loader.js:778:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:789:10)
(node:10592) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 3)

esta es la parte del módulo /home/<USER_NAME>/Documents/projects/<APP_NAME>/node_modules/@expo/cli/build/src/api/rest/client.js

class ApiV2Error extends Error {
    name = "ApiV2Error";
    constructor(response){
        super(response.message);
        this.code = response.code;
        this.expoApiV2ErrorCode = response.code;
        this.expoApiV2ErrorDetails = response.details;
        this.expoApiV2ErrorServerStack = response.stack;
        this.expoApiV2ErrorMetadata = response.metadata;
    }
}

Alguna idea?

@amari21
Copy link

amari21 commented May 9, 2023

¡Hola! A mí me sucede lo siguiente después de intentar instalar:

npm WARN deprecated @npmcli/move-file@1.1.2: This functionality has been moved to @npmcli/fs
npm WARN deprecated stable@0.1.8: Modern JS already guarantees Array#sort() is a stable sort, so this library is deprecated. See the compatibility table on MDN: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/sort#browser_compatibility
npm WARN deprecated uuid@3.4.0: Please upgrade  to version 7 or higher.  Older versions may use Math.random() in certain circumstances, which is known to be problematic.  See https://v8.dev/blog/math-random for details.
npm WARN deprecated uuid@3.4.0: Please upgrade  to version 7 or higher.  Older versions may use Math.random() in certain circumstances, which is known to be problematic.  See https://v8.dev/blog/math-random for details.
npm WARN deprecated uuid@3.4.0: Please upgrade  to version 7 or higher.  Older versions may use Math.random() in certain circumstances, which is known to be problematic.  See https://v8.dev/blog/math-random for details.

added 1173 packages in 28s

104 packages are looking for funding
  run `npm fund` for details

Busqué en varios foros, pero nada me funciona :')

@fer060890
Copy link

a mi tambien me sale lo mismo

@Isa-josep
Copy link

tengo un problema hace como unos 5 meses ya usaba react native y funcionaba bien, lo quise usar y me decia que intalara expo-cli lo hice con
npm install -g expo-cli y lo deje instalando por casi 12 horas y nunca termino, mi conexión de internet es buena no se si me puedan ayudar

@ayrtoncu
Copy link

Tengo una problema para trabajar React Native, no puedo hacer la creacion del proyecto.
Este es el Error que me sale:
´´´
× Something went wrong in downloading and extracting the project files: Could not parse JSON returned from "npm.cmd pack expo-template-blank@latest --dry-run".

expo-template-blank-49.0.22.tgz

Error: Unexpected token 'e', "expo-templ"... is not valid JSON
Error: Could not parse JSON returned from "npm.cmd pack expo-template-blank@latest --dry-run".

expo-template-blank-49.0.22.tgz

Error: Unexpected token 'e', "expo-templ"... is not valid JSON
´´´
Ya reintente de todo, actualice el Node, el npm, desinstale el node y todo. Pero sigo teniendo el mismo error. Alguien puede ayudarme?

@EduHerreraC13
Copy link

me aparece esto:
npm warn deprecated osenv@0.1.5: This package is no longer supported.
npm warn deprecated inflight@1.0.6: This module is not supported, and leaks memory. Do not use it. Check out lru-cache if you want a good and tested way to coalesce async requests by a key value, which is much more comprehensive and powerful.
npm warn deprecated @npmcli/move-file@1.1.2: This functionality has been moved to @npmcli/fs
npm warn deprecated osenv@0.1.5: This package is no longer supported.
npm warn deprecated inflight@1.0.6: This module is not supported, and leaks memory. Do not use it. Check out lru-cache if you want a good and tested way to coalesce async requests by a key value, which is much more comprehensive and powerful.
npm warn deprecated @babel/plugin-proposal-optional-catch-binding@7.18.6: This proposal has been merged to the ECMAScript standard and thus this plugin is no longer maintained. Please use @babel/plugin-transform-optional-catch-binding instead.
npm warn deprecated @babel/plugin-proposal-nullish-coalescing-operator@7.18.6: This proposal has been merged to the ECMAScript standard and thus this plugin is no longer maintained. Please use @babel/plugin-transform-nullish-coalescing-operator instead.
npm warn deprecated @babel/plugin-proposal-numeric-separator@7.18.6: This proposal has been merged to the ECMAScript standard and thus this plugin is no longer maintained. Please use @babel/plugin-transform-numeric-separator instead.
npm warn deprecated @babel/plugin-proposal-export-namespace-from@7.18.9: This proposal has been merged to the ECMAScript standard and thus this plugin is no longer maintained. Please use @babel/plugin-transform-export-namespace-from instead.
npm warn deprecated @babel/plugin-proposal-class-properties@7.18.6: This proposal has been merged to the ECMAScript standard and thus this plugin is no longer maintained. Please use @babel/plugin-transform-class-properties instead.
npm warn deprecated rimraf@2.4.5: Rimraf versions prior to v4 are no longer supported
npm warn deprecated stable@0.1.8: Modern JS already guarantees Array#sort() is a stable sort, so this library is deprecated. See the compatibility table on MDN: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/sort#browser_compatibility
npm warn deprecated rimraf@2.4.5: Rimraf versions prior to v4 are no longer supported
npm warn deprecated rimraf@2.7.1: Rimraf versions prior to v4 are no longer supported
npm warn deprecated rimraf@2.7.1: Rimraf versions prior to v4 are no longer supported
npm warn deprecated rimraf@2.7.1: Rimraf versions prior to v4 are no longer supported
npm warn deprecated rimraf@2.7.1: Rimraf versions prior to v4 are no longer supported
npm warn deprecated rimraf@2.7.1: Rimraf versions prior to v4 are no longer supported
npm warn deprecated @babel/plugin-proposal-optional-chaining@7.21.0: This proposal has been merged to the ECMAScript standard and thus this plugin is no longer maintained. Please use @babel/plugin-transform-optional-chaining instead.
npm warn deprecated topo@3.0.3: This module has moved and is now available at @hapi/topo. Please update your dependencies as this version is no longer maintained an may contain bugs and security issues.
npm warn deprecated @babel/plugin-proposal-object-rest-spread@7.20.7: This proposal has been merged to the ECMAScript standard and thus this plugin is no longer maintained. Please use @babel/plugin-transform-object-rest-spread instead.
npm warn deprecated rimraf@3.0.2: Rimraf versions prior to v4 are no longer supported
npm warn deprecated glob@6.0.4: Glob versions prior to v9 are no longer supported
npm warn deprecated glob@6.0.4: Glob versions prior to v9 are no longer supported
npm warn deprecated move-concurrently@1.0.1: This package is no longer supported.
npm warn deprecated figgy-pudding@3.5.2: This module is no longer supported.
npm warn deprecated @babel/plugin-proposal-async-generator-functions@7.20.7: This proposal has been merged to the ECMAScript standard and thus this plugin is no longer maintained. Please use @babel/plugin-transform-async-generator-functions instead.
npm warn deprecated request-promise-native@1.0.9: request-promise-native has been deprecated because it extends the now deprecated request package, see request/request#3142
npm warn deprecated abab@2.0.6: Use your platform's native atob() and btoa() methods instead
npm warn deprecated glob@7.1.6: Glob versions prior to v9 are no longer supported
npm warn deprecated har-validator@5.1.5: this library is no longer supported
npm warn deprecated copy-concurrently@1.0.5: This package is no longer supported.
npm warn deprecated glob@7.2.3: Glob versions prior to v9 are no longer supported
npm warn deprecated hoek@6.1.3: This module has moved and is now available at @hapi/hoek. Please update your dependencies as this version is no longer maintained an may contain bugs and security issues.
npm warn deprecated formidable@1.2.6: Please upgrade to latest, formidable@v2 or formidable@v3! Check these notes: https://bit.ly/2ZEqIau
npm warn deprecated querystring@0.2.1: The querystring API is considered Legacy. new code should use the URLSearchParams API instead.
npm warn deprecated xmldom@0.1.31: Deprecated due to CVE-2021-21366 resolved in 0.5.0
npm warn deprecated fs-write-stream-atomic@1.0.10: This package is no longer supported.
npm warn deprecated node-fetch-npm@2.0.4: This module is not used anymore, npm uses minipass-fetch for its fetch implementation now
npm warn deprecated uuid@3.4.0: Please upgrade to version 7 or higher. Older versions may use Math.random() in certain circumstances, which is known to be problematic. See https://v8.dev/blog/math-random for details.
npm warn deprecated raven@2.6.4: Please upgrade to @sentry/node. See the migration guide https://bit.ly/3ybOlo7
npm warn deprecated uuid@3.4.0: Please upgrade to version 7 or higher. Older versions may use Math.random() in certain circumstances, which is known to be problematic. See https://v8.dev/blog/math-random for details.
npm warn deprecated uuid@3.4.0: Please upgrade to version 7 or higher. Older versions may use Math.random() in certain circumstances, which is known to be problematic. See https://v8.dev/blog/math-random for details.
npm warn deprecated uuid@3.4.0: Please upgrade to version 7 or higher. Older versions may use Math.random() in certain circumstances, which is known to be problematic. See https://v8.dev/blog/math-random for details.
npm warn deprecated uuid@2.0.3: Please upgrade to version 7 or higher. Older versions may use Math.random() in certain circumstances, which is known to be problematic. See https://v8.dev/blog/math-random for details.
npm warn deprecated uuid@3.3.2: Please upgrade to version 7 or higher. Older versions may use Math.random() in certain circumstances, which is known to be problematic. See https://v8.dev/blog/math-random for details.
npm warn deprecated request@2.88.2: request has been deprecated, see request/request#3142
npm warn deprecated superagent@3.8.3: Please upgrade to v9.0.0+ as we have fixed a public vulnerability with formidable dependency. Note that v9.0.0+ requires Node.js v14.18.0+. See ladjs/superagent#1800 for insight. This project is supported and maintained by the team at Forward Email @ https://forwardemail.net
npm warn deprecated joi@14.0.4: This version has been deprecated in accordance with the hapi support policy (hapi.im/support). Please upgrade to the latest version to get the best features, bug fixes, and security patches. If you are unable to upgrade at this time, paid support is available for older versions (hapi.im/commercial).
npm warn deprecated axios@0.19.0-beta.1: Beta version should not be used anymore
npm warn deprecated raven-js@3.27.2: Please upgrade to @sentry/browser. See the migration guide https://bit.ly/3ybOlo7
npm warn deprecated core-js@2.6.12: core-js@<3.23.3 is no longer maintained and not recommended for usage due to the number of issues. Because of the V8 engine whims, feature detection in old core-js versions could cause a slowdown up to 100x even if nothing is polyfilled. Some versions have web compatibility issues. Please, upgrade your dependencies to the actual version of core-js.
npm warn deprecated @expo/traveling-fastlane-linux@1.5.0: Deprecated in favor of eas-cli

added 548 packages, and changed 1291 packages in 5m

180 packages are looking for funding
run npm fund for details

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment