小编Cha*_*nka的帖子

在 M1 Silicon 中的 HomeBrew 上安装 hyperkit 时出错

我尝试在 MacOS 12.1 M1 Silicon 上安装 hyperkit,但出现以下错误。

 % brew install hyperkit
    Error: hyperkit: no bottle available!
    You can try to install from source with:
      brew install --build-from-source hyperkit
    Please note building from source is unsupported. You will encounter build
    failures with some formulae. If you experience any issues please create pull
    requests instead of asking for help on Homebrew's GitHub, Twitter or any other
    official channels.
Run Code Online (Sandbox Code Playgroud)

经过一些研究,我发现与 M1 Silicon 处理器不兼容M1 兼容性问题

有解决方法吗?

我想在 M1 Silicon 上设置 minishift,而 Hyperkit …

macos openshift minishift hyperkit apple-m1

15
推荐指数
2
解决办法
1万
查看次数

在 (Bash/Docker RUN) 中以非交互方式自动回答 bash 命令的多个提示

有一些方法可以在 bash 命令中自动回答 -y,例如

RUN apt-get install -y nodejs
Run Code Online (Sandbox Code Playgroud)

但我有这个案子我想跑

 dpkg --install someDebianpackage.deb && apt install --assume-yes --fix-broken
Run Code Online (Sandbox Code Playgroud)

它实际上为它给出的即时提示回答 y 但在后期它要求我配置地理区域并回答 6

在此处输入图片说明

在那之后,我想用 20 来回答与时区对应的城市的命令

在此处输入图片说明

然后再次回答 31,然后 1 与上述相同,用于不同的问题。

我想知道的是以非交互式方式将此命令作为单个命令运行。(我希望制作一个 docker 文件,并将上述命令与其他一些可以链接&&RUN 命令中的命令放在一起,例如

RUN apt-get update && apt-get install sudo && "the above command along with their answers" && "some other command"
Run Code Online (Sandbox Code Playgroud)

我非常感谢对此的一些指导

linux bash docker dockerfile docker-compose

5
推荐指数
0
解决办法
172
查看次数

无法访问 Ant Modal 中的 this.setState 或 this.state 确认确定/取消功能

我在访问onCancel/onOk 函数时this.state遇到问题。this.setState我想修改确认或取消弹出模态后的状态。如果有人有不同的方法,您的指导将会有所帮助。

import React from 'react';
import { Button, Modal } from 'antd';

class ExampleClass extends React.Component {
  constructor() {
    super();

    this.state = {
      bankInfo: 100,
    };
  }

  onButtonClicked() {
    this.setState({ bankInfo: 200 });            // works fine
    Modal.confirm({
      title: 'Are you sure delete this item?',
      okType: 'danger',
      onOk() {
        this.setState({ bankInfo: 300 }); // Uncaught TypeError: Cannot read property 'setState' of undefined
      },
      onCancel() {
        this.setState({ bankInfo: 400 }); // Uncaught TypeError: Cannot read property 'setState' …
Run Code Online (Sandbox Code Playgroud)

javascript reactjs antd ant-design-pro react-class-based-component

2
推荐指数
1
解决办法
1190
查看次数