且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

VSCode:找不到任务中的环境变量

更新时间:2023-11-16 21:34:04

在您的情况下使用$env:APP_NAME.请参见引用环境变量.

Use$env:APP_NAME in your case. See referencing environment variables.

环境变量

您还可以通过${env:Name}引用环境变量 语法(例如${env:PATH}).

You can also reference environment variables through ${env:Name} syntax (for example, ${env:PATH}).

{
    "type": "node",
    "request": "launch",
    "name": "Launch Program",
    "program": "${workspaceFolder}/app.js",
    "cwd": "${workspaceFolder}",
    "args": [ "${env:USERNAME}" ]
}

注意:请确保匹配环境变量名称的大小写,例如 例如Windows上的${env:Path}.

Note: Be sure to match the environment variable name's casing, for example ${env:Path} on Windows.