Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

451
Vistas
How to view javascript compiler error messages when running Node program from VSCode?

In VCode, if I hit F5 (Start Debugging), this produces:

enter image description here

No useful exception or other errors are sent to the PROBLEMS, OUTPUT, TERMINAL or DEBUG CONSOLE tabs. Where are my error details?

But if I directly run it from the command-line, I get actual useful output:

$ /home/sir/.nvm/versions/node/v12.16.1/bin/node ./app.js
/home/sir/jstest/app.js:2
import 'xxxxx';
^^^^^^

SyntaxError: Cannot use import statement outside a module
    at wrapSafe (internal/modules/cjs/loader.js:1072:16)
    at Module._compile (internal/modules/cjs/loader.js:1122:27)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:1178:10)
    at Module.load (internal/modules/cjs/loader.js:1002:32)
    at Function.Module._load (internal/modules/cjs/loader.js:901:14)
    at Function.executeUserEntryPoint [as runMain] (internal/modules/run_main.js:74:12)
    at internal/main/run_main_module.js:18:47

This seems reasonable. Why can't I see the same VSCode?

I have added a NodeJS Launch Program run configuration: .vscode/launch.json:

{
    // 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": "${workspaceFolder}/app.js",
        "request": "launch",
        "skipFiles": [
            "<node_internals>/**"
        ],
        "type": "pwa-node"
    }
    ]
}

(I have verified it is used by changing the app.js target to some junk, and seeing an error).

The simple program I want to see compiler errors for is, app.js:

import 'xxxxx';   // An error, missing file

Also... I hope (in 2021) VSCode could hightlight this as an error in the editor. Is that not a feature?

about 4 years ago · Juan Pablo Isaza
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda