“Attribute 'program' does not exist” for basic node.js project

前端 未结 12 1599
南方客
南方客 2021-01-31 13:08

I created simple node.js application (source code from here https://azure.microsoft.com/en-us/blog/visual-studio-code-and-azure-app-service-a-perfect-fit/)

var h         


        
12条回答
  •  情书的邮戳
    2021-01-31 13:47

    The error is saying that the path to your code was wrong.

    VSCode defines the parent directory of its configuration file ".vscode/launch.json" as "${workspaceRoot}" or "${workspaceFolder}".

    So, for example, if you want to run file "myproject/subfolder/main.js", you should configure your "myproject/.vscode/launch.json" as follows: "program": "${workspaceRoot}/subfolder/main.js"

    Note that configuring "program": "${workspaceRoot}/myproject/subfolder/main.js" is a mistake and will cause error "Attribute 'program' does not exist".

提交回复
热议问题