Skip to content

Instantly share code, notes, and snippets.

@Klerith
Created March 3, 2021 20:56
Show Gist options
  • Save Klerith/89d5288dec7ff254913453d26a63e981 to your computer and use it in GitHub Desktop.
Save Klerith/89d5288dec7ff254913453d26a63e981 to your computer and use it in GitHub Desktop.
Comando para crear aplicación de React Native con TypeScript

Comando para crear un proyecto de RN con TS

npx react-native init AwesomeTSProject --template react-native-template-typescript
@FavioMagallanes
Copy link

npx react-native init MyApp --template react-native-template-typescript --npm

Usen este comando los que sigan teniendo error - 2023!

graciaas

@SamitoX4
Copy link

SamitoX4 commented Feb 15, 2024

Para poder saber que pasa, siempre es bueno ir a la documentacion la cual dice:

v0.70
Getting Started with TypeScript:
npx react-native init MyApp --template react-native-template-typescript

Ahora para la version actual:

v0.73
Getting Started with TypeScript:
New projects created by the React Native CLI or popular templates like Ignite will use TypeScript by default.

Entonces viendo lo que dice en la ultima actualizacion, nos damos cuenta que ya viene por defecto y no es necesario el comando del profesor Fernando.

Nota: Para los que se adelantaron y no pusieron typescript o es una version sin typescript entonces en la misma parte del doc dice como agregarlo, espeficicamente aqui:

Adding TypeScript to an Existing Project

Saludos.

@martin19850926
Copy link

buenas estoy presentando este error
λ npx react-native init proyecto
node:internal/modules/cjs/loader:1143
throw err;
^

Error: Cannot find module 'commander'
Require stack:

  • C:\Users\Lazaro\AppData\Local\npm-cache_npx\7930a8670f922cdb\node_modules@react-native-community\cli\build\index.js
  • C:\Users\Lazaro\AppData\Local\npm-cache_npx\7930a8670f922cdb\node_modules@react-native-community\cli\build\bin.js
    at Module._resolveFilename (node:internal/modules/cjs/loader:1140:15)
    at Module._load (node:internal/modules/cjs/loader:981:27)
    at Module.require (node:internal/modules/cjs/loader:1231:19)
    at require (node:internal/modules/helpers:177:18)
    at _commander (C:\Users\Lazaro\AppData\Local\npm-cache_npx\7930a8670f922cdb\node_modules@react-native-community\cli\build\index.js:43:16)
    at Object. (C:\Users\Lazaro\AppData\Local\npm-cache_npx\7930a8670f922cdb\node_modules@react-native-community\cli\build\index.js:59:22)
    at Module._compile (node:internal/modules/cjs/loader:1364:14)
    at Module._extensions..js (node:internal/modules/cjs/loader:1422:10)
    at Module.load (node:internal/modules/cjs/loader:1203:32)
    at Module._load (node:internal/modules/cjs/loader:1019:12) {
    code: 'MODULE_NOT_FOUND',
    requireStack: [
    'C:\Users\Lazaro\AppData\Local\npm-cache\_npx\7930a8670f922cdb\node_modules\@react-native-community\cli\build\index.js',
    'C:\Users\Lazaro\AppData\Local\npm-cache\_npx\7930a8670f922cdb\node_modules\@react-native-community\cli\build\bin.js'
    ]
    }

Node.js v18.20.1

@cuadros-code
Copy link

export const colors = {
darkGray: '#2D2D2D',
ligthGray: '#9B9B9B',
orange: '#FF9427',

textPrimary: '#ffffff',
textSecondary: '#666666',
background: '#000000'
}

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