Typescript 错误:“预期类型来自属性‘webPreferences’,它在此处声明为类型‘BrowserWindowConstructorOptions’”

问题描述 投票:0回答:0

我正在尝试运行 bishop fox 的 unredacter。对于我的生活,我无法编译代码。我将它放入 VScode 进行调试,由于我不了解 typescript 或 js(只有基本的 html),所以我无法判断出什么问题。 VS code 说有两个错误,我贴了其中的截图。无法在线找到有关该问题或解决方案的任何相关信息。我希望有人能指出我如何解决这个问题的方向,因为我一直在尝试运行这个程序几个星期的大部分时间。谢谢。

VS Code Debug 1

"message": "Type '{ preload: string; nodeIntegration: false; worldSafeExecuteJavaScript: true; contextIsolation: true; }' is not assignable to type 'WebPreferences'.\n  Object literal may only specify known properties, and 'worldSafeExecuteJavaScript' does not exist in type 'WebPreferences'.",
    "source": "ts",
    "startLineNumber": 20,
    "startColumn": 7,
    "endLineNumber": 20,
    "endColumn": 39,
    "relatedInformation": [
        {
            "startLineNumber": 13642,
            "startColumn": 5,
            "endLineNumber": 13642,
            "endColumn": 19,
            "message": "The expected type comes from property 'webPreferences' which is declared here on type 'BrowserWindowConstructorOptions'",

VS Code Debug 2

"message": "Type '{ sandbox: true; webSecurity: true; contextIsolation: true; webviewTag: false; enableRemoteModule: false; allowRunningInsecureContent: false; nodeIntegration: false; nodeIntegrationInWorker: false; nodeIntegrationInSubFrames: false; nativeWindowOpen: false; safeDialogs: true; }' is not assignable to type 'WebPreferences'.\n  Object literal may only specify known properties, and 'enableRemoteModule' does not exist in type 'WebPreferences'.",
    "source": "ts",
    "startLineNumber": 177,
    "startColumn": 7,
    "endLineNumber": 177,
    "endColumn": 32,
    "relatedInformation": [
        {
            "startLineNumber": 13642,
            "startColumn": 5,
            "endLineNumber": 13642,
            "endColumn": 19,
            "message": "The expected type comes from property 'webPreferences' which is declared here on type 'BrowserWindowConstructorOptions'",
javascript node.js typescript
© www.soinside.com 2019 - 2024. All rights reserved.