欢迎您访问程序员文章站本站旨在为大家提供分享程序员计算机编程知识!
您现在的位置是: 首页  >  IT编程

TypeError: cb.apply is not a function

程序员文章站 2022-06-15 19:10:23
参考升级Node版本RN项目运行报错cb.apply is not a function错误Loading dependency graph, done. DELTA [android, dev] ./index.js ░░░░░░░░░░░░░░░░ 0.0% (0/1)/Users/tmk/Downloads/Timekettle/node_modules/graceful-fs/polyfills.js:285 if (cb) cb.apply(this, argumen...

参考

升级Node版本RN项目运行报错cb.apply is not a function

错误

Loading dependency graph, done.
 DELTA  [android, dev] ./index.js ░░░░░░░░░░░░░░░░ 0.0% 
 (0/1)/Users/tmk/Downloads/Timekettle/node_modules/graceful-fs/polyfills.js:285
        if (cb) cb.apply(this, arguments)
                   ^

TypeError: cb.apply is not a function
    at /Users/tmk/Downloads/Timekettle/node_modules/graceful-fs/polyfills.js:285:20
    at FSReqCallback.oncomplete (node:fs:192:5)
Process terminated. Press <enter> to close the window

解决:

查看报错的源码,在node_module/graceful-fs/polyfills.js的285行

TypeError: cb.apply is not a function

看注释应该用来处理旧版本的问题,查看这个方法的调用位置发现在61-63行

TypeError: cb.apply is not a function

对于我们来说,既然是旧版的问题,我们就不用关心了,直接把调用的方法注释调就行了。

本文地址:https://blog.csdn.net/sinat_31057219/article/details/112506883

相关标签: javascript