Я пытаюсь запустить собственное приложение в Android с сервера Linux, теперь я получаю эту ошибку при попытке запустить сервер npm с npm-start'
.
> test0app@0.0.1 start /home/lenovot430/Documents/ReactProjects/test0app
> node node_modules/react-native/local-cli/cli.js start
┌──────────────────────────────────────────────────────────────────────────────┐
│ │
│ Running Metro Bundler on port 8081. │
│ │
│ Keep Metro running while developing on any JS projects. Feel free to │
│ close this tab and run your own Metro instance if you prefer. │
│ │
│ https://github.com/facebook/react-native │
│ │
└──────────────────────────────────────────────────────────────────────────────┘
events.js:183
throw er; // Unhandled 'error' event
^
Error: listen EADDRINUSE :::8081
at Server.setupListenHandle [as _listen2] (net.js:1360:14)
at listenInCluster (net.js:1401:12)
at Server.listen (net.js:1485:7)
at Promise (/home/lenovot430/Documents/ReactProjects/test0app/node_modules/metro/src/index.js:253:20)
at new Promise (<anonymous>)
at Object.<anonymous> (/home/lenovot430/Documents/ReactProjects/test0app/node_modules/metro/src/index.js:252:14)
at Generator.next (<anonymous>)
at asyncGeneratorStep (/home/lenovot430/Documents/ReactProjects/test0app/node_modules/metro/src/index.js:46:24)
at _next (/home/lenovot430/Documents/ReactProjects/test0app/node_modules/metro/src/index.js:66:9)
at <anonymous>
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! test0app@0.0.1 start: `node node_modules/react-native/local-cli/cli.js start`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the test0app@0.0.1 start script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
npm ERR! A complete log of this run can be found in:
npm ERR! /home/lenovot430/.npm/_logs/2019-04-29T09_09_45_424Z-debug.log
Если я попытаюсь запустить «реагировать на запуск», приложение застревает на экране загрузки.
Исправления, которые я пытался исправить
Удалены узлы, очищены кеши и снова установлены.
rm -rf node_modules && npm cache clean --force && npm install
Неустановленный и переустановленный сторож
brew uninstall watchman
brew link pcre
brew install --HEAD watchman
brew install watchman
Клонированный сторожевой репозиторий и пробная версия 4.9.0
$ git clone https://github.com/facebook/watchman.git
$ cd watchman
$ git checkout v4.9.0 # the latest stable release
$ ./autogen.sh
$ ./configure
$ make
$ sudo make install
Я не внес никаких изменений в конфигурацию собственного приложения реагирования. Я попытался создать новый проект с react-native init
, но в этом же проекте я получаю ту же ошибку.
Мой package.json
файл
{
"name": "test0app",
"version": "0.0.1",
"private": true,
"scripts": {
"start": "node node_modules/react-native/local-cli/cli.js start",
"test": "jest"
},
"dependencies": {
"react": "16.8.3",
"react-native": "0.59.5"
},
"devDependencies": {
"@babel/core": "^7.4.4",
"@babel/runtime": "^7.4.4",
"babel-jest": "^24.7.1",
"jest": "^24.7.1",
"metro-react-native-babel-preset": "^0.53.1",
"react-test-renderer": "16.8.3"
},
"jest": {
"preset": "react-native"
}
}