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

120
Views
js files under node_modules not found when using Angularjs with node.js

My application is serving angularjs's index.html from node as below,

app.get('/', function (req, res) {
       res.render('index');
})

When I open the application in browser, I see following errors on node console, The below files are not found,

GET /node_modules/zone.js/dist/zone.js 404 7.506 ms - 172
GET /node_modules/core-js/client/shim.min.js 404 8.439 ms - 178
GET /systemjs.config.js 304 9.265 ms - -
GET /node_modules/systemjs/dist/system.src.js 404 12.038 ms - 179
GET /node_modules/zone.js/dist/zone.js 404 0.622 ms - 172
GET /node_modules/systemjs/dist/system.src.js 404 0.589 ms - 179

I tried using CDN path as below,

<script src="https://unpkg.com/core-js@2.4.1/client/shim.min.js"></script>
<script src="https://unpkg.com/zone.js@0.8.4/dist/zone.js"></script>
<script src="https://unpkg.com/systemjs@0.19.39/dist/system.src.js"></script>

but then it is unable to load some other js files under node_modules. This all works fine when I use angular pages statically without express. How do I refer to js files under node_modules so these are loaded correctly.

about 4 years ago · Santiago Trujillo
1 answers
Answer question

0

You need to serve them as static files : documentation here

about 4 years ago · Santiago Trujillo 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!