Hi, I am using Visual Studio Code and I created my launch.json file. The parse server config is saved in config.json. Please see the following file.
{
// Use IntelliSense to learn about possible attributes.
// Hover to view descriptions of existing attributes.
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
"version": "0.2.0",
"configurations": [
{
"name": "Launch Program",
"program": "./bin/parse-server config.json",
"request": "launch",
"skipFiles": [
"<node_internals>/**"
],
"type": "pwa-node",
"console": "integratedTerminal"
}
]
}
However, when I click “start debugging”, VSC says “cannot find module”. However, when I type "parse-server config.json"in VSC terminal. The code works. Please see the following error info. Does anyone know why this happened? Thanks
parse-server % cd /private/var/www/parse_server_example/parse_server_src/parse-server ; /usr/bin/env 'NODE_OPTIONS=--require "/Applications/Visual Studio Code.app/Contents/Resources/app/extensions/ms-vscode.js-debug/src/bootloader.bundle.js" --inspect-publish-uid=http' 'VSCODE_INSPECTOR_OPTIONS={"inspectorIpc":"/var/folders/nm/yg8m79rx6bg46q_p72dr9fyr0000gn/T/node-cdp.47034-17.sock","deferredMode":false,"waitForDebugger":"","execPath":"/usr/local/bin/node","onlyEntrypoint":false,"autoAttachMode":"always","fileCallback":"/var/folders/nm/yg8m79rx6bg46q_p72dr9fyr0000gn/T/node-debug-callback-c1e933366d9ac50e"}' /usr/local/bin/node "./bin/parse-server config.json"
Debugger attached.
Waiting for the debugger to disconnect...
internal/modules/cjs/loader.js:892
throw err;
^
Error: Cannot find module '/private/var/www/parse_server_example/parse_server_src/parse-server/bin/parse-server config.json'
at Function.Module._resolveFilename (internal/modules/cjs/loader.js:889:15)
at Function.Module._load (internal/modules/cjs/loader.js:745:27)
at Function.executeUserEntryPoint [as runMain] (internal/modules/run_main.js:76:12)
at internal/main/run_main_module.js:17:47 {
code: 'MODULE_NOT_FOUND',
requireStack: []
}