我试图在Heroku上部署我的项目。我已经能够heroku open
该应用程序,看到它,但我得到了我的bundle.js
404。该应用程序在github here上。该应用程序在heroku here。在Heroku上部署NodeJS/Babel/Grunt应用程序
我试着确定我的依赖关系是否有关于babel,babelify,grunt等等。但是我必须仍然错过了一些东西。
我没有得到任何错误,我git push heroku
后,但我还是把我的404
我试图在Heroku上部署我的项目。我已经能够heroku open
该应用程序,看到它,但我得到了我的bundle.js
404。该应用程序在github here上。该应用程序在heroku here。在Heroku上部署NodeJS/Babel/Grunt应用程序
我试着确定我的依赖关系是否有关于babel,babelify,grunt等等。但是我必须仍然错过了一些东西。
我没有得到任何错误,我git push heroku
后,但我还是把我的404
我能够在本地重建这一点。这是我所得到的,当我运行postinstall
脚本代码:
$ npm run postinstall
> [email protected] postinstall ncps-mms
> gulp transpile --gulpfile client/gulpfile.babel.js
[00:18:43] Requiring external module babel-register
[00:18:43] Working directory changed to ncps-mms/client
(node:30276) fs: re-evaluating native module sources is not supported. If you are using the graceful-fs module, please update it to a more recent version.
[00:18:43] Using gulpfile ncps-mms/client/gulpfile.babel.js
[00:18:44] Starting 'transpile'...
Error: Cannot find module './controllers/members-detail-controller' from 'ncps-mms/client/src'
[00:18:44] Finished 'transpile' after 184 ms
我看到这个错误:
Error: Cannot find module './controllers/members-detail-controller' from 'ncps-mms/client/src'
成员细节控制器丢失 - 请参阅:https://github.com/gh0st/ncps-mms/tree/master/client/src/controllers。
如果我注释掉以下几行,https://github.com/gh0st/ncps-mms/blob/master/client/src/app.js#L4和https://github.com/gh0st/ncps-mms/blob/master/client/src/app.js#L15然后再次运行npm run postinstall
,吞噬任务运行时没有错误。然后,我可以在没有bundle.js上的404的情况下启动服务器。
因此,运行'npm run watch'应该启动transpile进程并监视源代码的更改。缺少的模块不是一个交易断路器,编译/运行没有它。 – gh0st
您可以通过以下命令检查代码的日志详细信息:heroku logs -n 200 –