Невозможно создать новое приложение, используя «create-Reaction-native-app» - PullRequest
0 голосов
/ 28 сентября 2018

До сегодняшнего дня я никогда не сталкивался с какими-либо проблемами при создании собственных программ реагирования с помощью команды cli «create-Reaction-native-app».Он не создает обычные файлы ios и android, которые он создает, а создает только файлы node_modules, package-lock.json и package.json.Ниже приведен вывод, который я получил при запуске команды.

    $ create-react-native-app Rdx
Creating a new React Native app in /Users/apple/Documents/Vscode/Redux-Testing/Rdx.

Using package manager as npm with npm interface.
Installing packages. This might take a couple minutes.
Installing react-native-scripts...

npm notice created a lockfile as package-lock.json. You should commit this file.
+ react-native-scripts@2.0.1
added 20 packages in 19.223s
(node:73947) UnhandledPromiseRejectionWarning: Error: Cannot find module '/Users/apple/Documents/Vscode/Redux-Testing/Rdx/node_modules/react-native-scripts/build/scripts/init.js'
    at Function.Module._resolveFilename (module.js:547:15)
    at Function.Module._load (module.js:474:25)
    at Module.require (module.js:596:17)
    at require (internal/module.js:11:18)
    at _callee2$ (/Users/apple/npm/lib/node_modules/create-react-native-app/build/index.js:128:32)
    at tryCatch (/Users/apple/npm/lib/node_modules/create-react-native-app/node_modules/regenerator-runtime/runtime.js:62:40)
    at Generator.invoke [as _invoke] (/Users/apple/npm/lib/node_modules/create-react-native-app/node_modules/regenerator-runtime/runtime.js:296:22)
    at Generator.prototype.(anonymous function) [as next] (/Users/apple/npm/lib/node_modules/create-react-native-app/node_modules/regenerator-runtime/runtime.js:114:21)
    at step (/Users/apple/npm/lib/node_modules/create-react-native-app/node_modules/babel-runtime/helpers/asyncToGenerator.js:17:30)
    at /Users/apple/npm/lib/node_modules/create-react-native-app/node_modules/babel-runtime/helpers/asyncToGenerator.js:28:13
(node:73947) 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:73947) [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.

Заранее благодарю за поддержку!

1 Ответ

0 голосов
/ 28 сентября 2018

Это потому, что react-native-scripts старый пакет, который используется create-react-native-app, возможно, теперь ваша версия create-react-native-app будет version: 1.0.0.

обновить пакет.

npm install -g create-react-native-app

сейчас create-react-native-app версия будет 2.0.2.

Теперь вы готовы создать свое приложение.

create-react-native-app Rdx

Возможно, вас попросят установить expo-cli скажем Y.

Еще одна хорошая вещь в create-react-native-app 2.0.2 - вы можете создавать blank или tabs приложение.используйте клавиши со стрелками, чтобы выбрать предпочитаемое приложение в терминале.

Добро пожаловать на сайт PullRequest, где вы можете задавать вопросы и получать ответы от других членов сообщества.
...