我最近将我的react-native软件包和package.json中的其他软件包升级到最新版本。每次我尝试编译项目时,我都会在终端遇到这个错误:
TypeError: Cannot read property 'replace' of undefined
at Module.extractRequires [as _extractor] (PATH_TO_PROJECT/node_modules/react-native/packager/react-packager/src/node-haste/lib/extractRequires.js:31:10)
at codePromise.then.result (PATH_TO_PROJECT/node_modules/react-native/packager/react-packager/src/node-haste/Module.js:209:49)
at tryCallOne (PATH_TO_PROJECT/node_modules/promise/lib/core.js:37:12)
at PATH_TO_PROJECT/node_modules/promise/lib/core.js:123:15
at flush (PATH_TO_PROJECT/node_modules/asap/raw.js:50:29)
at _combinedTickCallback (internal/process/next_tick.js:67:7)
at process._tickCallback (internal/process/next_tick.js:98:9)
模拟器抛出以下错误:
{"type":"InternalError","message":"react-packager has encountered an internal error, please check your terminal error output for more details"}
我不知道这是源代码问题,还是我在更新我的npm软件包时搞砸了。