1
votes

erreur d'éjection react-native Commande "éjecter" non reconnue

J'essaye d'éjecter mon application pour générer un dossier Android. Je savais que cela fonctionnait avant, mais lorsque je tape react-native eject dans le répertoire racine de mon projet React Native, j'obtiens:

 System:
    OS: macOS 10.14.5
    CPU: (8) x64 Intel(R) Core(TM) i7-7920HQ CPU @ 3.10GHz
    Memory: 62.21 MB / 16.00 GB
    Shell: 3.2.57 - /bin/bash
  Binaries:
    Node: 12.4.0 - /usr/local/bin/node
    Yarn: 1.17.0 - /usr/local/bin/yarn
    npm: 6.4.1 - /usr/local/bin/npm
    Watchman: 4.9.0 - /usr/local/bin/watchman
  SDKs:
    iOS SDK:
      Platforms: iOS 12.2, macOS 10.14, tvOS 12.2, watchOS 5.2
  IDEs:
    Android Studio: 3.4 AI-183.6156.11.34.5522156
    Xcode: 10.2/10E125 - /usr/bin/xcodebuild
  npmPackages:
    react: 16.8.6 => 16.8.6 
    react-native: 0.60.0-rc.2 => 0.60.0-rc.2

Je l'ai recherché, mais chaque réponse indique que l' react-native eject est simplement la forme correcte et je n'ai rien trouvé concernant le fait que cela ne fonctionne pas.

Voici mes informations système de la commande react-native info :

can-mbp:MyApp can$ react-native eject
warn Your project is using deprecated "rnpm" config that will stop working from next release. Please use a "react-native.config.js" file to configure the React Native CLI. Migration guide: https://github.com/react-native-community/cli/blob/master/docs/configuration.md
warn Package "bugsnag-react-native" is using deprecated "rnpm" config that will stop working from next release. Please notify its maintainers about it.
warn Package "react-native-onesignal" is using deprecated "rnpm" config that will stop working from next release. Please notify its maintainers about it.
warn Package react-native-onesignal has been ignored because it contains invalid configuration. Reason: Unknown option dependency.platforms.ios.sourceDir with value ""./ios"" was found. This is either a typing error or a user mistake. Fixing it will remove this message.
error Unrecognized command "eject".
info Run "react-native --help" to see a list of all available commands.

Qu'est-ce que je fais mal?


2 commentaires

quelle est la version native de réactif cli?


@Victor CLI est 2.0.1


3 Réponses :


1
votes

Since create-react-native-app is deprecated this functionality is no longer needed.

En raison de ce pr, il est parti!

Personnellement, je ne l'aime pas mais lancez npx react-native init YourProjectName et copiez ce qui est nécessaire.

Mise à jour: j'ai copié le code supprimé et créé un petit paquet: https://www.npmjs.com/package/react-native-eject


0 commentaires

0
votes

Tapez la commande suivante npx react-native eject


0 commentaires

0
votes

Travaille toujours pour moi, première installation dans votre projet

react-native eject

puis exécutez

yarn add react-native-eject

assurez-vous que vous avez installé du fil dans votre PC


0 commentaires