Valeriy Valeriy - 8 months ago 93
Node.js Question

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

I created simple node.js application (source code from here

var http = require('http');
http.createServer(function (req, res) {
console.log('Got request for ' + req.url);
res.writeHead(200, {'Content-Type': 'text/html'});
res.end('<h1>Hello Code and Azure Web Apps!</h1>');

And clicked VSCode generated launch.json:

"version": "0.2.0",
"configurations": [
"name": "Launch",
"type": "node",
"request": "launch",
"program": "${workspaceRoot}/app.js",
"stopOnEntry": false,
"args": [],
"cwd": "${workspaceRoot}",
"preLaunchTask": null,
"runtimeExecutable": null,
"runtimeArgs": [
"env": {
"NODE_ENV": "development"
"externalConsole": false,
"sourceMaps": false,
"outDir": null
"name": "Attach",
"type": "node",
"request": "attach",
"port": 5858,
"address": "localhost",
"restart": false,
"sourceMaps": false,
"outDir": null,
"localRoot": "${workspaceRoot}",
"remoteRoot": null

And still when launched I see:

Attribute 'program' does not exist.

Can anybody help what's wrong?


I believe that you need ${workspaceRoot}/server.js, not ${workspaceRoot}/app.js for program. The code you're using doesn't have an app.js, that's what that (poorly worded) error is telling you.