我尝试在heroku上部署我的Sails.js WebApp并遇到这些错误:
app[web.1]: Grunt :: Running "uglify:dist" (uglify) task heroku[web.1]: Error R14 (Memory quota exceeded) heroku[web.1]: Process running mem=704M(137.5%) heroku[web.1]: Error R10 (Boot timeout) -> Web process failed to bind to $PORT within 60 seconds of launch heroku[web.1]: Process exited with status 137
所以我知道我可以在本地运行uglify和其他grunt任务,然后将创建的./tmp文件夹推送到heroku并从NODE_ENV=production node app.js
删除任务
我做了什么:
1:
$ NODE_ENV=production node app.js
$ git add ./tmp
2:
评论tasks/prod.js
中的任务:
grunt.registerTask('prod', [
/* 'compileAssets',
'concat',
'uglify',
'cssmin',
'sails-linker:prodJs',
'sails-linker:prodStyles',
'sails-linker:devTpl',
'sails-linker:prodJsJade',
'sails-linker:prodStylesJade',
'sails-linker:devTplJade'*/
]);
3:
$ git add tasks/prod.js
$ git commit -m "Am I doing it right?"
$ git push heroku master
但是现在Sever没有开始:
app[web.1]: Grunt :: Done, without errors. app[web.1]: grunt hook loaded successfully. heroku[web.1]: Error R10 (Boot timeout) -> Web process failed to bind to $PORT within 60 seconds of launch heroku[web.1]: Process exited with status 137
如何在本地运行Grunt任务并将结果推送到heroku而无需在Sails.js应用中再次运行这些任务?