小编Ami*_*mir的帖子

错误:EMFILE:打开的文件太多 - React Native CLI

我尝试使用 react-native start 运行 react-native-cli 项目,但是 Metro bundler 失败了,说如下:

events.js 187
throw er; //Unhandled 'error' event

Error: EMFILE: too many open files, watch

Emitted 'error' event on NodeWatcher isntance at:
     at NodeWatcher: checkedEmitError (.../react-native-project/node_modules/sane/src/node_watcher.js:143:12)
     at FSWatcher.emit (events.js:210:5)
     at FSEvent.FSWatcher:_handle onchange (internal/fs/watchers.js:129:12) {
   errno: -24,
   syscall: 'watch',
   code : 'EMFILE',
   filename: null
)
Process terminated. Press <enter> to close the window
Run Code Online (Sandbox Code Playgroud)

react-native react-native-ios

31
推荐指数
9
解决办法
3万
查看次数

Amazon S3 获取请求和 S3 数据检索之间的区别

关于 Amazon S3 的理论问题。

S3-IA Get 请求的定价存在差异:$.001 / 10K 和 S3 数据检索成本:$.01。

我的问题是,获取请求和数据检索之间有什么区别?

amazon-s3 amazon-web-services

6
推荐指数
1
解决办法
4332
查看次数

使用 AWS Amplify 从 React Native 上传到 S3

我正在尝试使用 Amplify 将图像从 React Native 上传到 S3。我能够成功上传文本文件。但不是图像。

这是我的代码:

import React from 'react';
import {View, Text, Button, Image} from 'react-native';
import {identityPoolId, region, bucket} from '../auth';
import image from '../assets/background.png';
import Amplify, {Storage} from 'aws-amplify';

Amplify.configure({
    Auth: {identityPoolId,region},
    Storage : {bucket,region}
})

const upload = () => {
    Storage.put('logo.jpg', image, {contentType: 'image/jpeg'})
        .then(result => console.log('result from successful upload: ', result))
        .catch(err => console.log('error uploading to s3:', err));
}

const get = () => {   //this works for both putting and getting …
Run Code Online (Sandbox Code Playgroud)

image amazon-s3 amazon-web-services react-native aws-amplify

5
推荐指数
1
解决办法
3752
查看次数

世博会不断停止android模拟器

我正在使用 android 模拟器在 Windows 10 上运行 expo 应用程序。隧道建立,模拟器启动。但世博会在模拟器上不断崩溃。

在此处输入图片说明

我尝试从模拟器中卸载 expo,然后重新启动机器。有任何想法吗?

android react-native react-native-android expo

4
推荐指数
1
解决办法
3242
查看次数

JavaScript 类中使用箭头函数的继承和多态性

为什么箭头函数优先于 JavaScript 类中的函数声明?

例子 :


class Parent {

    work = () => {
        console.log('This is work() on the Parent class');
    }
}

class Child extends Parent {

    work() {
        console.log("This is work() on the Child class ");
    }

}

const kid = new Child();

kid.work();
Run Code Online (Sandbox Code Playgroud)

在这个例子中,父 work() 方法被触发:

“这是父类上的 work()”

我只是想了解为什么箭头函数在 JS 类中总是优先,尤其是在继承和多态方面。

javascript polymorphism inheritance class es6-class

4
推荐指数
1
解决办法
491
查看次数