Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

234
Visualizações
How do I serve static files in Express using VS code?

Please be patient, I'm new at this. I've set up myapp using this tutorial - https://code.visualstudio.com/docs/nodejs/nodejs-tutorial and now I'm trying to serve static files using this tutorial - https://expressjs.com/en/starter/static-files.html, but I'm getting errors and I'm lost as to how to fix them. The errors are below. Please help and thank you!

express.static : The term 'express.static' is not recognized 
as the name of a cmdlet, function, script file, or operable 
program. Check the spelling of the name, or if a path was   
included, verify that the path is correct and try again.        
At line:1 char:9
+ app.use(express.static('public'))
+         ~~~~~~~~~~~~~~
   + CategoryInfo          : ObjectNotFound: (express.static:  
  String) [], CommandNotFoundException
   + FullyQualifiedErrorId : CommandNotFoundException
about 4 years ago · Juan Pablo Isaza
1 Respostas
Responde à pergunta

0

You appear to be trying to execute a fragment of JS as a PowerShell script.

JS isn't PowerShell so it errors.

You need to:

  1. create a JS file
  2. build the basics of an Express.js based server in it (see the Hello World example on the Express.js website)
  3. add the static middleware to that program
  4. execute that JS file using node.js
about 4 years ago · Juan Pablo Isaza Relatório
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda