静态资产不在Heroku上,但在本地?

我有一个nodeJS + expressJS + Angular2-RC.5的网站,在我的本地Windows 10机器上正常工作。 但是,当我尝试部署( 这里的日志)到Heroku并访问该网站时,前端控制台(Chrome)抛出以下错误,并且不加载站点。 RXJs似乎没有在Heroku上提供一些问题?

zone.js:101 GET https://ns-docs.herokuapp.com/node_modules/rxjs/RX.js 404(Not Found)

在这里输入图像说明

我的systemjs.config.js包含这个:

 (function(global) { // map tells the System loader where to look for things var map = { 'app': '/app', // 'dist', '@angular': '/node_modules/@angular', 'angular2-in-memory-web-api': '/node_modules/angular2-in-memory-web-api', 'rxjs': '/node_modules/rxjs' }; // packages tells the System loader how to load when no filename and/or no extension var packages = { 'app': { main: 'main.js', defaultExtension: 'js' }, 'rxjs': { defaultExtension: 'js' }, 'angular2-in-memory-web-api': { main: 'index.js', defaultExtension: 'js' }, }; System.config(config); })(this); 

和我的index.html包含:

 ... <script src="/node_modules/core-js/client/shim.min.js"></script> <script src="/node_modules/zone.js/dist/zone.js"></script> <script src="/node_modules/reflect-metadata/Reflect.js"></script> <script src="/node_modules/systemjs/dist/system.src.js"></script> <!-- 2. Configure SystemJS --> <script src="/config/systemjs.config.js"></script> <script> System.import('app').catch(function(err){ console.error(err); }); </script> <base href="/"> </head> 

所以如果我在本地运行项目, http://localhost:3000/node_modules/rxjs/RX.js显示js源代码。 然而,如果我把这个项目推到Heroku,用这个构build日志,那个版本会在/node_modules/rxjs/RX.js上返回一个404

更新:

如果我克隆我的回购到我的机器上的一个新的位置,cd到项目根目录,运行npm i ,然后git submodule update --init" then节点./ bin / www”,那么项目在本地主机上运行良好,我推测这意味着所有的回购信息都足以让项目起作用,所以我的怀疑仍然在于我的静态驴在Heroku和我的本地机器上的服务方式。

那么服务器可能是基于Linux的,那里的文件/文件夹名称区分大小写。 Rx.js不是RX.js 所以你有一个错误的import地方