我所有的 react-native 项目都显示错误 TypeError: cb.apply is not a function [英] All my react-native projects shows error TypeError: cb.apply is not a function

查看:38
本文介绍了我所有的 react-native 项目都显示错误 TypeError: cb.apply is not a function的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我对 react-native 真的很陌生.我所有的项目早上都运行良好,但不知何故他们停止了工作.当我运行 react-native start 和 react-native run-android 时,应用程序安装在设备上,但随后出现了这个错误,这在以前没有发生过.

I'm realtively new to react-native. All my projects were running fine in the morning, but somehow they stopped working. When I run react-native start and the react-native run-android, the app gets installed on the device but then this error props up which was not happening before.

Loading dependency graph, done.
 DELTA  [android, dev] ./index.js ░░░░░░░░░░░░░░░░ 0.0% (0/1)/home/yehyaumar/Documents/dumm/busybee/node_modules/graceful-fs/polyfills.js:285
        if (cb) cb.apply(this, arguments)
                   ^

TypeError: cb.apply is not a function
    at /home/yehyaumar/Documents/dumm/busybee/node_modules/graceful-fs/polyfills.js:285:20
    at FSReqCallback.oncomplete (fs.js:169:5)

我什至从头开始克隆 repo,但错误仍然存​​在.请帮忙.RN 版本:0.59.2

I even cloned the repo from from scratch, but still the error persists. Please help out. RN version: 0.59.2

我的一个项目的 package.json 文件,

My package.json file for one project,

{
  "name": "projectalpha",
  "version": "0.0.1",
  "private": true,
  "scripts": {
    "start": "node node_modules/react-native/local-cli/cli.js start",
    "test": "jest",
    "lint": "eslint ."
  },
  "dependencies": {
    "@react-native-community/async-storage": "^1.11.0",
    "axios": "^0.18.0",
    "react": "16.8.3",
    "react-native": "0.59.2",
    "react-native-awesome-alerts": "^1.2.0",
    "react-native-circle-checkbox": "^0.1.6",
    "react-native-circular-progress": "^1.1.0",
    "react-native-gesture-handler": "^1.1.0",
    "react-native-google-places-autocomplete": "^1.3.9",
    "react-native-image-picker": "^0.28.1",
    "react-native-maps": "react-native-community/react-native-maps#master",
    "react-native-maps-directions": "^1.6.0",
    "react-native-onesignal": "^3.2.12",
    "react-native-reanimated": "^1.0.0-alpha.12",
    "react-native-svg": "^9.4.0",
    "react-native-svg-charts": "^5.2.0",
    "react-native-swiper": "^1.5.14",
    "react-native-tab-view": "^2.0.3",
    "react-native-vector-icons": "^6.4.2",
    "react-navigation": "^3.6.0",
    "unstated": "^2.1.1"
  },
  "devDependencies": {
    "@babel/core": "^7.4.0",
    "@babel/runtime": "^7.4.2",
    "@react-native-community/eslint-config": "^0.0.3",
    "babel-jest": "^24.5.0",
    "eslint": "^5.15.3",
    "jest": "^24.5.0",
    "metro-react-native-babel-preset": "^0.53.1",
    "react-test-renderer": "16.8.3"
  },
  "jest": {
    "preset": "react-native"
  },
  "rnpm": {
    "assets": [
      "./assets/fonts/"
    ]
  }
}

推荐答案

Ciao,这个问题与graceful-fs 包有关.请重新安装 graceful-fs:

Ciao, this problem is connected to graceful-fs package. Plase, reinstall graceful-fs:

npm install graceful-fs --save-dev

问题应该得到解决.

这篇关于我所有的 react-native 项目都显示错误 TypeError: cb.apply is not a function的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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