小编s-l*_*ndz的帖子

gitlab-ci SSH 密钥格式无效

我想使用 gitlab-ci 运行部署脚本,但步骤 ssh-add$SSH_PRIVATE_KEY返回错误:

echo "$SSH_PRIVATE_KEY" | ssh-add -
Error loading key "(stdin)": invalid format
Run Code Online (Sandbox Code Playgroud)

你可以看到我的.gitlab-ci.yml

deploy:
  image: node:9.11.1-alpine
  stage: deploy
  before_script:
    # Install ssh-agent if not already installed, it is required by Docker.
    # (change apt-get to yum if you use a CentOS-based image)
    - 'which ssh-agent || ( apk add --update openssh )'

    # Add bash
    - apk add --update bash

    # Add git
    - apk add --update git

    # Run ssh-agent (inside the …
Run Code Online (Sandbox Code Playgroud)

gitlab gitlab-ci

31
推荐指数
8
解决办法
2万
查看次数

Docker使用nginx构建主机路径错误

当我docker-compose up nginx使用主机路径运行时出错:

错误:for nginx无法启动服务nginx:oci运行时错误:container_linux.go:247:启动容器进程导致"process_linux.go:359:容器init导致"rootfs_linux.go:54:mount \\"/ d/Sites/lfdwveille/app/config/docker/nginx.conf \\"to rootfs \\"/ mnt/sda1/var/lib/docker/aufs/mnt/fce42187ef3ff6bcc0d5acf53a77d2218348a432063e2d5fe00b8ac945578f63 \\"at \\"/ mnt/sda1/var/lib /docker/aufs/mnt/fce42187ef3ff6bcc0d5acf53a77d2218348a432063e2d5fe00b8ac945578f63/etc/nginx/nginx.conf \\"导致\\"不是目录\\"\""

:您是否尝试将目录挂载到文件上(反之亦然)?检查指定的主机路径是否存在且是否为预期类型

[31mERROR [0m:在启动项目时遇到错误.

文件夹url是正确的:(我不知道为什么nginx不想要mount文件夹,我对PHP和MySQL没有问题.

我的设置:

  • 视窗
  • docker-compose v1.9.0
  • 码头工人1.12

错误日志:

container_linux.go:247:启动容器进程导致"process_linux.go:359:容器初始化导致"rootfs_linux.go:54:mount \\"/ d/Sites/lfdwveille/app/config/docker/nginx.conf \\ "to rootfs \\"/ mnt/sda1/var/lib/docker/aufs/mnt/fce42187ef3ff6bcc0d5acf53a77d2218348a432063e2d5fe00b8ac945578f63 \\"at \\"/ mnt/sda1/var/lib/docker/aufs/mnt/fce42187ef3ff6bcc0d5acf53a77d2218348a432063e2d5fe00b8ac945578f63/etc/nginx/nginx.conf \\"导致\\"不是目录\\"\""

有人有想法吗?

谢谢 !

nginx docker docker-compose

10
推荐指数
1
解决办法
1432
查看次数

Electron-builder 更改 Windows 上的安装目录

我想更改 Windows 上的安装目录,我的 Electron 应用程序是使用electron-builder.

我尝试将installer.nsh文件放入构建文件夹中,但它仍然相同,它始终安装在默认路径下AppData/Roaming/

这是我的installer.nsh

!macro preInit
 SetRegView 64
  WriteRegExpandStr HKLM "${INSTALL_REGISTRY_KEY}" InstallLocation "C:\CustomPath"
  WriteRegExpandStr HKCU "${INSTALL_REGISTRY_KEY}" InstallLocation "C:\CustomPath"
 SetRegView 32
  WriteRegExpandStr HKLM "${INSTALL_REGISTRY_KEY}" InstallLocation "C:\CustomPath"
  WriteRegExpandStr HKCU "${INSTALL_REGISTRY_KEY}" InstallLocation "C:\CustomPath"
!macroend
Run Code Online (Sandbox Code Playgroud)

有没有人设法使用 Electron-builder 更改默认安装目录?

谢谢你!

electron electron-builder

9
推荐指数
1
解决办法
7338
查看次数

是的,验证访问parent.parent

我正在使用yup模块来验证我的表单。我想访问父级以测试该值。

我的架构:

enabled: yup.boolean(),
contactDetail: yup.object().shape({
  phoneNumber1: yup.string().nullable(),
  phoneNumber2: yup.string().nullable(),
  email: yup.string().test('email', 'test', async function() {
    // test enabled value
  })
}),
Run Code Online (Sandbox Code Playgroud)

该方法when可以在同一级别访问,而不是父级。

有人有主意吗?

javascript forms yup

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

在React Native中将按钮设置在“固定”位置

我想在React Native中将按钮设置在右下角的宽度固定位置。

position: fixed不能在React Native中使用,并且stickyHeaderIndicesScrollView中的方法不允许将元素放置在其他组件上方。

有人已经测试过此功能吗?

css react-native

8
推荐指数
3
解决办法
2万
查看次数

使用Babel 7未定义错误regeneratorRuntime

我想在Electron项目中将我的Babel配置更新到版本7.

我添加了我需要的所有插件:

"devDependencies": {
    "@babel/cli": "^7.0.0-beta.40",
    "@babel/core": "^7.0.0-beta.40",
    "@babel/node": "^7.0.0-beta.40",
    "@babel/plugin-proposal-class-properties": "^7.0.0-beta.40",
    "@babel/plugin-proposal-decorators": "^7.0.0-beta.40",
    "@babel/plugin-proposal-object-rest-spread": "^7.0.0-beta.40",
    "@babel/plugin-proposal-optional-chaining": "^7.0.0-beta.40",
    "@babel/plugin-transform-async-to-generator": "^7.0.0-beta.40",
    "@babel/polyfill": "^7.0.0-beta.40",
    "@babel/preset-env": "^7.0.0-beta.40",
    "@babel/preset-react": "^7.0.0-beta.40",
    "babel-eslint": "^7.1.1",
Run Code Online (Sandbox Code Playgroud)

编译是好的,但当Electron运行我的main.js(编译)时,我有这个错误:

A JavaScript error occurred in the main process Uncaught Exception: ReferenceError: regeneratorRuntime is not defined

我试着安装regeneratorRuntime模块,但没有结果.

babel node.js electron

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

Volta 和全局 npm 包

我在现有的 Node 项目上尝试 Volta 工具。这是非常好的工具:)

但是,我可以使用全局包吗?例如,我运行过:

npm i -g gitmoji-cli

然后,我尝试使用gitmoji,但它在命令行上未定义。我使用的是正确的节点版本,但我不太明白为什么找不到 gitmoji。

你知道我是否需要其他参数吗?

如果有人已经使用过这个工具并安装全局包..:)

在此输入图像描述

node.js npm volta

7
推荐指数
1
解决办法
8609
查看次数

VSCode更漂亮的react / jsx-max-props-per-line格式

我在带有React的JavaScript项目中使用Prettier。我所有的组件道具都格式化为1行:

<Icon icon="arrow-left" width={15} height={18} />

我想这样:

<Icon
  icon="arrow-left"
  width={15}
  height={18}
/>
Run Code Online (Sandbox Code Playgroud)

我已经添加"react/jsx-max-props-per-line": [1, { "when": "multiline" }]到我的.prettierrc,但是没有结果。

我也有一个ESLint配置,使用以下规则:

{
  "extends": [
    "eslint:recommended",
    "plugin:react/recommended",
    "plugin:prettier/recommended"
  ],
  "plugins": ["react", "prettier", "standard"],
  "rules": {
    "indent": [2, 2, { "SwitchCase": 1 }],
    "quotes": [2, "single"],
    "linebreak-style": [2, "unix"],
    "semi": [2, "always"],
    "no-console": [0],
    "no-loop-func": [0],
    "new-cap": [0],
    "no-trailing-spaces": [0],
    "no-param-reassign": [0],
    "func-names": [0],
    "comma-dangle": [0],
    "no-unused-expressions": [0],
    "block-scoped-var": [0],
    "react/prop-types": [0],
    "prettier/prettier": "error"
  }
}
Run Code Online (Sandbox Code Playgroud)

我的.prettier文件配置:

  "bracketSpacing": true,
  "jsxBracketSameLine": true,
  "printWidth": …
Run Code Online (Sandbox Code Playgroud)

javascript reactjs eslint prettier

6
推荐指数
3
解决办法
3382
查看次数

编码为 base64 密钥库文件

我想编码我的 .keystore 文件以在 Gitlab-ci 中使用。因此,对于编码 sur base64,我运行以下命令:

openssl base64 -A -in myFile.keystore

对于解码:

openssl base64 -d <<< $KEY > myFile.keystore

但是,如果我使用我的文件,则会出现此错误: Invalid keystore format

我已经通过运行将我的初始文件与新的解码文件进行了比较md5sum oldFile.keystore myFile.keystore,但文件是相同的:/

有人有想法吗?

感谢社区!

android openssl keystore

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

@babel/preset-env 不转译 ES6 类

我已经将我的 Babel 配置升级到 v7 并添加了@babel/preset-env用于转译我的 ES2015+ 代码的包。

但是,所有 ES6 类都不会被转译。我的 .babelrc 文件:

{
    "presets": [
        [
            "@babel/preset-env",
            {
                "targets": {
                    "browsers": [
                        "last 2 versions",
                        "safari > 7",
                        "ie > 9"
                    ]
                }
            }
        ]
    ],
    "plugins": [
        "@babel/plugin-proposal-optional-chaining",
        "@babel/plugin-proposal-object-rest-spread"
    ]
}
Run Code Online (Sandbox Code Playgroud)

我不明白为什么,有人可以帮助我吗?

感谢社区!

javascript babeljs

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