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

119
Vistas
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 Respuestas
Responde la pregunta

0

You need to serve them as static files : documentation here

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