缺少 FORGE_CLIENT_ID 或 FORGE_CLIENT_SECRET 环境。变量

Missing FORGE_CLIENT_ID or FORGE_CLIENT_SECRET env. variables

It shows:Missing FORGE_CLIENT_ID or FORGE_CLIENT_SECRET env. variables

按照node.js的教程一步一步来,最后测试发现ID和密码都是空的values.I最后直接把ID和密码写到config.js,该项目几乎没有进行。

最简单的方法是在您的 .vscode/launch.json 中添加一个 env 属性,如下所示。笔记。 Client Id 和 Secret 不是您的开发者 ID 和密码。请参考 OAuth create an app tutorial - Step 3: Note Down Your Client ID and Secret 查看您的 Client Id 和 Secret。

{
    // Use IntelliSense to learn about possible attributes.
    // Hover to view descriptions of existing attributes.
    // For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
    "version": "0.2.0",
    "configurations": [
        {
            "type": "node",
            "request": "launch",
            "name": "Launch Program",
            "skipFiles": [
                "<node_internals>/**"
            ],
            "program": "${workspaceFolder}/start.js",
            "env": {
                "FORGE_CLIENT_ID": "",
                "FORGE_CLIENT_SECRET": "",
                "FORGE_CALLBACK_URL": "http://localhost:3000/api/forge/callback/oauth"
            }
        }
    ]
}