安装react-native-country-picker-modal后出现内部错误

时间:2017-06-22 11:48:29

标签: android ios reactjs react-native

您好,当我安装react-native-country-picker-modal并将此import CountryPicker, {getAllCountries} from 'react-native-country-picker-modal';添加到我的组件时,我在SIM卡中收到此错误。当我删除此行时,错误就消失了。

{"type":"internalError","message":"react-packager has encountered an internal error, pelase check your terminal error output for more details"}

我试图解决它几个小时,无法解决问题。任何想法为什么会发生这种情况或如何解决?

以下是安装此软件包时会发生的情况。

$ npm i react-native-country-picker-modal --save
taddar_mobile_app@0.0.1 /Users/josephkonop/Documents/Projects/taddar_mobile_app
└─┬ react-native-country-picker-modal@0.3.0-rc1
  └── react-native-emoji@1.2.0  (git://github.com/niftylettuce/react-native-emoji.git#70275d5e36cc9933f4d571fae7fa519ab566ca38)

npm WARN react-static-container@1.0.1 requires a peer of react@^0.13.0 || ^0.14.0 || ^15.0.0 but none was installed.

日志

Error: EISDIR: illegal operation on a directory, read
    at Error (native)
    at Object.fs.readSync (fs.js:725:19)
    at Object.readSync (/Users/my_name/Documents/Projects/taddar_mobile_app/node_modules/graceful-fs/polyfills.js:138:28)
    at tryReadSync (fs.js:480:20)
    at Object.fs.readFileSync (fs.js:528:19)
    at _readSourceCodePromise.resolve (/Users/my_name/Documents/Projects/taddar_mobile_app/node_modules/react-native/packager/src/node-haste/Module.js:191:31)
    at Module._readSourceCode (/Users/my_name/Documents/Projects/taddar_mobile_app/node_modules/react-native/packager/src/node-haste/Module.js:190:37)
    at Module._readDocBlock (/Users/my_name/Documents/Projects/taddar_mobile_app/node_modules/react-native/packager/src/node-haste/Module.js:199:29)
    at Module._getHasteName (/Users/my_name/Documents/Projects/taddar_mobile_app/node_modules/react-native/packager/src/node-haste/Module.js:209:32)
    at _cache.get (/Users/my_name/Documents/Projects/taddar_mobile_app/node_modules/react-native/packager/src/node-haste/Module.js:130:18)

1 个答案:

答案 0 :(得分:0)

终止本地打包服务器并重新启动它。我有同样的问题,解决方案是重启包装服务器。我也通过NPM安装了这个,不确定是否有帮助。