npm ERR!在project@0.0.1启动脚本'react-native start'处失败 [英] npm ERR! Failed at the project@0.0.1 start script 'react-native start'

查看:76
本文介绍了npm ERR!在project@0.0.1启动脚本'react-native start'处失败的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

npm -v:3.10.10 react-native -v:0.1.7 节点-v:v6.9.5 Ubuntu的:16.04 守望者-v:4.5.0

npm -v : 3.10.10 react-native -v :0.1.7 node -v : v6.9.5 ubuntu: 16.04 watchman -v : 4.5.0

再次执行本机初始化项目 cd项目 和本机运行Android ,当我执行npm开始运行服务器时,出现此错误:

Afrer executing react-native init project cd project and react-native run-android ,When i execute npm start to run server i have this error :

project@0.0.1 start /home/sofiane/projet/merde2
> react-native start

Cannot parse yarn version: 0.22
Scanning 547 folders for symlinks in /home/sofiane/projet/project/node_modules (3ms)
 ┌────────────────────────────────────────────────────────────────────────────┐ 
 │  Running packager on port 8081.                                            │ 
 │                                                                            │ 
 │  Keep this packager running while developing on any JS projects. Feel      │ 
 │  free to close this tab and run your own packager instance if you          │ 
 │  prefer.                                                                   │ 
 │                                                                            │ 
 │  https://github.com/facebook/react-native                                  │ 
 │                                                                            │ 
 └────────────────────────────────────────────────────────────────────────────┘ 
Looking for JS files in
   /home/sofiane/projet/project

Loading dependency graph...
React packager ready.

jest-haste-map: Watchman crawl failed. Retrying once with node crawler.
  Usually this happens when watchman isn't running. Create an empty `.watchmanconfig` file in your project's root folder or initialize a git or hg repository in your project.
  Error: A non-recoverable condition has triggered.  Watchman needs your help!
The triggering condition was at timestamp=1488805737: inotify-add-watch(/home/sofiane/projet/sql3/node_modules/react-native/ReactAndroid/src/main/third-party/java/junit) -> The user limit on the total number of inotify watches was reached; increase the fs.inotify.max_user_watches sysctl
All requests will continue to fail with this message until you resolve
the underlying problem.  You will find more information on fixing this at
https://facebook.github.io/watchman/docs/troubleshooting.html#poison-inotify-add-watch

 ERROR  A non-recoverable condition has triggered.  Watchman needs your help!
The triggering condition was at timestamp=1488805737: inotify-add-watch(/home/sofiane/projet/sql3/node_modules/react-native/ReactAndroid/src/main/third-party/java/junit) -> The user limit on the total number of inotify watches was reached; increase the fs.inotify.max_user_watches sysctl
All requests will continue to fail with this message until you resolve
the underlying problem.  You will find more information on fixing this at
https://facebook.github.io/watchman/docs/troubleshooting.html#poison-inotify-add-watch

{"watchmanResponse":{"version":"4.5.0","error":"A non-recoverable condition has triggered.  Watchman needs your help!\nThe triggering condition was at timestamp=1488805737: inotify-add-watch(/home/sofiane/projet/sql3/node_modules/react-native/ReactAndroid/src/main/third-party/java/junit) -> The user limit on the total number of inotify watches was reached; increase the fs.inotify.max_user_watches sysctl\nAll requests will continue to fail with this message until you resolve\nthe underlying problem.  You will find more information on fixing this at\nhttps://facebook.github.io/watchman/docs/troubleshooting.html#poison-inotify-add-watch\n"}}
Error: A non-recoverable condition has triggered.  Watchman needs your help!
The triggering condition was at timestamp=1488805737: inotify-add-watch(/home/sofiane/projet/sql3/node_modules/react-native/ReactAndroid/src/main/third-party/java/junit) -> The user limit on the total number of inotify watches was reached; increase the fs.inotify.max_user_watches sysctl
All requests will continue to fail with this message until you resolve
the underlying problem.  You will find more information on fixing this at
https://facebook.github.io/watchman/docs/troubleshooting.html#poison-inotify-add-watch

    at ChildProcess.<anonymous> (/home/sofiane/projet/project/node_modules/fb-watchman/index.js:207:21)
    at emitTwo (events.js:106:13)
    at ChildProcess.emit (events.js:191:7)
    at maybeClose (internal/child_process.js:877:16)
    at Process.ChildProcess._handle.onexit (internal/child_process.js:226:5)

See http://facebook.github.io/react-native/docs/troubleshooting.html
for common problems and solutions.

npm ERR! Linux 4.8.0-39-generic
npm ERR! argv "/home/sofiane/.nvm/v6.9.5/bin/node" "/home/sofiane/.nvm/v6.9.5/bin/npm" "start"
npm ERR! node v6.9.5
npm ERR! npm  v3.10.10
npm ERR! code ELIFECYCLE
npm ERR! merde2@0.0.1 start: `react-native start`
npm ERR! Exit status 11
npm ERR! 
npm ERR! Failed at the merde2@0.0.1 start script 'react-native start'.
npm ERR! Make sure you have the latest version of node.js and npm installed.
npm ERR! If you do, this is most likely a problem with the merde2 package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR!     react-native start
npm ERR! You can get information on how to open an issue for this project with:
npm ERR!     npm bugs merde2
npm ERR! Or if that isn't available, you can get their info via:
npm ERR!     npm owner ls merde2
npm ERR! There is likely additional logging output above.

npm ERR! Please include the following file with any support request:
npm ERR!     /home/sofiane/projet/project/npm-debug.log

推荐答案

我在ubuntu中遇到了同样的问题,对我有用的是关闭的终端从重新启动的usb中删除了我的设备.首先建议您将这些行添加到package.json中,用此替换脚本

i was having the same problem in ubuntu what worked for me is that i closed terminal removed my device from usb restarted. first of all would suggest you add these lines inside your packages.json replace scripts with this

"scripts": {
"prepare-repository": "npm i -g react-native-cli yarn;yarn install; react-native link",
"emulator": "emulator -avd Nexus5V6L23_x86_64 -scale 1.0",
"install": "react-native run-android",
"start": "react-native start --reset-cache",
"android": "npm run install && npm run start",
"clean": "watchman watch-del-all && npm cache clean && cd android && ./gradlew clean && cd ..",
"test": "jest"
}

之后,将其保存,然后转到创建项目的文件夹.可以说我的住所/工作区/演示.在该运行脚本中

After that save it and then go to the folder where u created project. lets say mine home/workspace/demo. Inside that run script

npm run clean this will clear all cache

之后

npm run android 

它将在设备以及启动重置缓存中运行应用程序.让我知道它是否有帮助.

It will run app in device as well as start-reset cache.Let me know if it helps.

编辑!!! 有时添加 在执行npm运行android之前,adb反向tcp:8081做tricj

Edit!!! Sometimes adding adb reverse tcp:8081 before running npm run android does the tricj

这篇关于npm ERR!在project@0.0.1启动脚本'react-native start'处失败的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆