gpt4 book ai didi

javascript - 找不到模块 {applicationPath}

转载 作者:搜寻专家 更新时间:2023-10-31 23:23:06 24 4
gpt4 key购买 nike

我正在尝试从 Visual Studio 代码以 Debug模式运行应用程序。当我单击调试时,出现以下错误:

A JavaScript error occurred in the main process

Uncaught Exception:
Error: Cannot find module 'C:\electron2\electron_app\--inspect-brk=15965'
at Module._resolveFilename (internal/modules/cjs/loader.js:602:15)
at Function.Module._resolveFilename (C:\electron2\electron_app\node_modules\electron\dist\resources\electron.asar\common\reset-search-paths.js:35:12)
at Function.Module._load (internal/modules/cjs/loader.js:528:25)
at Module.require (internal/modules/cjs/loader.js:658:17)
at init (C:\electron2\electron_app\node_modules\electron-compile\lib\config-parser.js:294:16)
at main (C:\electron2\electron_app\node_modules\electron-prebuilt-compile\lib\es6-init.js:58:29)
at Object.<anonymous> (C:\electron2\electron_app\node_modules\electron-prebuilt-compile\lib\es6-init.js:61:1)
at Object.<anonymous> (C:\electron2\electron_app\node_modules\electron-prebuilt-compile\lib\es6-init.js:63:3)
at Module._compile (internal/modules/cjs/loader.js:711:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:722:10)

我的调试配置是这样的

{
"version": "0.2.0",
"configurations": [
{
"name": "Debug",
"type": "node",
"request": "launch",
"cwd": "${workspaceRoot}",
"runtimeExecutable": "${workspaceRoot}/node_modules/.bin/electron",
"windows": {
"runtimeExecutable": "${workspaceRoot}/node_modules/.bin/electron.cmd"
},
"args" : ["."]
}
]
}

还发现了一个错误:

No such module: atom_browser_features

以前从未听说过这样的模块。

以前可以正常工作,但是突然不工作了。任何人都知道问题可能是什么?

最佳答案

您可能遇到问题,因为 --inspect-brk=15965 被解释为“主”脚本。

假设生成的命令行类似于 noseratio 的:

C:/test/node_modules/.bin/electron.cmd --remote-debugging-port=9223 . --inspect-brk=47365

您可以看到 --inspect-brk 出现在声明的参数之后,但是, Node 参数必须在“主”脚本之前声明。您可以尝试升级到 electron@3.0.8 以查看问题是否自行解决。或者,您可以尝试更明确地使用入口点,就像他们在 electron-quick-start 中所做的那样。项目。

{
"name": "Debug Main Process",
"type": "node",
"request": "launch",
"cwd": "${workspaceRoot}",
"runtimeExecutable": "${workspaceRoot}/node_modules/.bin/electron",
"windows": {
"runtimeExecutable": "${workspaceRoot}/node_modules/.bin/electron.cmd"
},
"program": "${workspaceRoot}/main.js",
"protocol": "inspector"
}

关于javascript - 找不到模块 {applicationPath},我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/52870487/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com