Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

233
Views
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 answers
Answer question

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 Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!