"Node.js application" launcher doesn't expand launch variables (eg `${workspace_loc:/myProject/test.js}`)
See original GitHub issueGiven a Generic Eclipse project my.project containing a file hello.js:
const http = require('http');
const hostname = '127.0.0.1';
const port = 3000;
const server = http.createServer((req, res) => {
res.statusCode = 200;
res.setHeader('Content-Type', 'text/plain');
res.end('Hello World');
});
server.listen(port, hostname, () => {
console.log(`Server running at http://${hostname}:${port}/`);
});
From Node.js getting started guide
The workspace looks like this:
I would like to start this using a “Node.js Application” launcher, but I am not able to configure it.
I always have this error Not allowed to read file., no matter the value I put in Program.
node hello.js(with the Working directory set to${workspace_loc:/my.project/})node ${workspace_loc:/my.project/hello.js}${workspace_loc:/my.project/hello.js}${workspaceFolder}/my.project/hello.js- …
Issue Analytics
- State:
- Created a year ago
- Comments:6 (3 by maintainers)
Top Results From Across the Web
How To Launch Child Processes in Node.js - DigitalOcean
Back in your terminal, run your application with the node command: node listFiles.js. Your terminal will display the following output: Output.
Read more >How do I add environment variables to launch.json in VSCode
I'm successfully passing them using the env property in launch.json : { "version": "0.2.0", "configurations": [ { "type": "pwa-node", ...
Read more >Process | Node.js v19.3.0 Documentation
The 'beforeExit' event is emitted when Node.js empties its event loop and has no additional work to schedule. Normally, the Node.js process will...
Read more >Debugging and profiling Node.js applications - IBM Developer
The command to run Node debugging client is: node inspect node_module . To start debugging the Shopping List application, open a terminal window ......
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found

Yes, the root issue is missing variable expansion. Having relative path to working directory would be good as well.
I merged #807 that should fix that. However, the UI to suggest Variables in launch config is still missing; it’s tracked in #808 . I’m closing this one so you can leverage the fix in upcoming snapshot build. Please reopen with details if it’s not resolved.