小编Eli*_*l58的帖子

jest 工作进程被另一个进程终止

当我构建应用程序时,出现以下错误。

Test suite failed to run

  A jest worker process (pid=2439) was terminated by another process: signal=SIGKILL, exitCode=null. Operating system logs may contain more information on why this occurred.
    at ChildProcessWorker._onExit (node_modules/jest-worker/build/workers/ChildProcessWorker.js:366:23)
Run Code Online (Sandbox Code Playgroud)

您能否建议如何检查 Linux 系统上的操作系统日志以及如何解决此问题?

linux jestjs

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

MongooseError:Model.findOne() 不再接受 Function 的回调

我在设置 mongoose 时遇到了问题。

这是我的代码:

const { SlashCommandBuilder } = require('@discordjs/builders');
const testSchema = require(`../../Schemas.js/test`);

module.exports = {
    data: new SlashCommandBuilder()
    .setName('dbtest')
    .setDescription('db test'),
    async execute(interaction) {

        testSchema.findOne({ GuildID: interaction.guild.id, UserID: interaction.user.id}, async(err, data) => {
            if (err) throw err;

            if (!data) {
                testSchema.create({
                    GuildID: interaction.guild.id,
                    UserID: interaction.user.id
                })
            }

            if (data) {
                console.log(data)
            }
        })
    }
}
Run Code Online (Sandbox Code Playgroud)

我的错误:

/Users/akimfly/akim-slash-bot/node_modules/mongoose/lib/model.js:2131
    throw new MongooseError('Model.findOne() no longer accepts a callback');
          ^

MongooseError: Model.findOne() no longer accepts a callback
    at Function.findOne (/Users/akimfly/akim-slash-bot/node_modules/mongoose/lib/model.js:2131:11)
    at Object.execute …
Run Code Online (Sandbox Code Playgroud)

javascript mongoose mongodb node.js discord.js

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

离子服务命令找不到参数

我有一个有角度的项目,我想在移动设备上使用 ionic。我做到了ionic init

当我运行命令时ionic serve,我收到此错误:

> ng.cmd run app:serve --host=localhost --port=8100
[ng] Error: Unknown arguments: host, port

[ERROR] ng has unexpectedly closed (exit code 1).

        The Ionic CLI will exit. Please check any output above for error details.
Run Code Online (Sandbox Code Playgroud)

这是我的package.json

> ng.cmd run app:serve --host=localhost --port=8100
[ng] Error: Unknown arguments: host, port

[ERROR] ng has unexpectedly closed (exit code 1).

        The Ionic CLI will exit. Please check any output above for error details.
Run Code Online (Sandbox Code Playgroud)

如何修复主机/端口缺少参数?

在SimpleDev …

ionic-framework angular

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

.NET 6 在其所在的确切目录中搜索时返回未找到视图

我最近正在使用新的最小托管模型从 .NET 5 MVC 应用程序迁移到 .NET 6 MVC 应用程序。在此迁移过程中,我一次又一次遇到“未找到视图”InvalidOperationException。证明视图位于正确的地图中并且程序在该位置“搜索”它: 证据

正如您所看到的,所有地图和文件名都是一致的。

我已经按照微软的迁移指南一步一步进行操作,但没有成功。就我个人而言,我认为添加端点时出了问题,但我已经尝试了 .NET 6 为我提供的每一个可能的选项来添加默认控制器路由。

app.UseEndpoints(endpoints => {
    endpoints.MapDefaultControllerRoute();
    endpoints.MapRazorPages();
});
Run Code Online (Sandbox Code Playgroud)

或这个

app.MapControllerRoute(
name: "default",
pattern: "{controller=Home}/{action=Index}/{id?}");
Run Code Online (Sandbox Code Playgroud)

当然还有这个

app.UseEndpoints(endpoints => {
    endpoints.MapControllerRoute(
        name: "default",
        pattern: "{controller=Home}/{action=Index}/{id?}");
    endpoints.MapRazorPages();
});
Run Code Online (Sandbox Code Playgroud)

但没有任何效果。在谷歌搜索后,我还没有真正在网上找到任何解决方案,这个问题只会让我陷入迁移困境。我希望有人能指出我正确的方向。

c# .net-6.0

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

使用 bubblewrap 构建 apk 时显示错误无法启动守护进程

我跑了gradlew.bat assembleRelease --stacktrace,我得到这个错误:

ERROR Command failed: gradlew.bat assembleRelease --stacktrace

FAILURE: Build failed with an exception.

* What went wrong:
Unable to start the daemon process.
This problem might be caused by incorrect configuration of the daemon.
For example, an unrecognized jvm option is used.
Please refer to the User Manual chapter on the daemon at https://docs.gradle.org/6.5/userguide/gradle_daemon.html
Process command line: C:\Users\Asus\.bubblewrap\jdk\jdk8u265-b01\bin\java.exe -Xmx1536m -Dfile.encoding=windows-1252 -Duser.country=US -Duser.language=en -Duser.variant -cp C:\Users\Asus\.gradle\wrapper\dists\gradle-6.5-bin\6nifqtx7604sqp1q6g8wikw7p\gradle-6.5\lib\gradle-launcher-6.5.jar org.gradle.launcher.daemon.bootstrap.GradleDaemon 6.5
Please read the following process output to find out …
Run Code Online (Sandbox Code Playgroud)

java web-applications build gradle progressive-web-apps

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

使用 SpringBoot 从资源中下载文件

如何从 reosurces/folderX/file.txt 获取文件

@PostMapping(value = "/uploadFile", produces = MediaType.APPLICATION_OCTET_STREAM_VALUE)
public ResponseEntity<Resource> uploadFile(@RequestParam("file") MultipartFile file) {
    /* 
     * FIRST I upload file
     * Next, I need to return different file in this request 
     */ 
    return ResponseEntity.ok().header(HttpHeaders.CONTENT_DISPOSITION, "attachment; filename=\"" + "file.txt + "\"").body();
}
Run Code Online (Sandbox Code Playgroud)

java spring-boot

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

Flexbox 删除两个子项之间的列间隙

这是代码:

.content {
    display: flex;
    justify-content: center;
    flex-direction: column;
    align-content: stretch;
}
Run Code Online (Sandbox Code Playgroud)
<div class="content">
    <h4>type</h4>
    <h4>exp</h4>
</div>
Run Code Online (Sandbox Code Playgroud)

它看起来是这样的:

______________________

        type


        exp

______________________

Run Code Online (Sandbox Code Playgroud)

如何缩小两个元素之间的间隙?我尝试了 css间隙:10px;列间隙:20px;, 这是行不通的。

html css frontend

0
推荐指数
1
解决办法
1200
查看次数