ReactNative常见错误

422 阅读1分钟

打包报错 SyntaxError: Unexpected token in JSON at position 0

运行命令查看具体信息

node node_modules/react-native/local-cli/cli.js --verbose  bundle --entry-file index.js --platform android --dev false --bundle-output ./android/bundles/index.android.bundle --assets-dest ./android/bundles

报错信息

at FileStore.get(:****\node_modules\metro-cache\src\stores\FileStore.js:26:19

解决方案:npm start -- --reset-cache