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.
You need to serve them as static files : documentation here