简体   繁体   English

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

[英]Internal Error After Installing react-native-country-picker-modal

Hello when I install react-native-country-picker-modal and add this import CountryPicker, {getAllCountries} from 'react-native-country-picker-modal'; 您好,当我安装react-native-country- import CountryPicker, {getAllCountries} from 'react-native-country-picker-modal'; -modal并import CountryPicker, {getAllCountries} from 'react-native-country-picker-modal';添加此import CountryPicker, {getAllCountries} from 'react-native-country-picker-modal'; to my component i receive this error in the sim. 到我的组件我在SIM卡中收到此错误。 When I remove this line the error is gone. 当我删除此行时,错误消失了。

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

I tried to fix it for hours and can't solve the issue. 我试图解决它几个小时,无法解决问题。 Any ideas why this is happening or how to fix it? 任何想法为什么会发生这种情况或如何解决它?

Here is what happens when i install this package. 以下是我安装此软件包时会发生的情况。

$ 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.

Logs 日志

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)

Kill your local packaging server and restart it. 杀死本地打包服务器并重新启动它。 I had this same issue and the solution was to restart the packaging server. 我有同样的问题,解决方案是重启包装服务器。 I also installed this via NPM, not sure if that helps. 我也通过NPM安装了这个,不确定是否有帮助。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM