I'm currently facing an issue with running my Express program in VSCode debugger, as it seems to be causing problems with the relative directory paths.
For instance, when I utilize a module like JIMP
, which is a Node image manipulator, the app works fine when executed from Powershell by entering the path relative to the project root (where the package.JSON
is located). However, when running it through the VSCode debugger, it encounters errors because it searches for the image relative to the app
directory within my project root.
Is there a configuration setting that can be modified to resolve this issue?
launch.json
:
{
// Use IntelliSense to learn about possible Node.js debug 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": "npm start",
"program": "${workspaceRoot}/app/app.js"
}
]
}
jsconfig.js
:
{
"compilerOptions": {
"target": "es6",
"module": "commonjs",
"allowSyntheticDefaultImports": true
},
"exclude": [
"node_modules"
]
}
Your assistance is greatly appreciated