Disclaimer: I'm a node.js/grunt/bower newbie.
I have a node.js/grunt/bower application that I'm trying to deploy on Heroku. Heroku builds the application as expected, but then it tries to run "npm start" which I did not specify in the package.json file. This command fails, I'm guessing because it is not a server application, and I can not see the actual application deployed in it's place on Heroku. My application can be found here: https://github.com/uzilan/sufusku
So - how do I get Heroku not to run the "npm start" command, and what should it run instead? After running grunt build, the application is available on the dist folder.
package.json:
{
"name": "sufusku",
"version": "0.0.1",
"description": "Sufusku - makes your annoying sudoku easier",
"repository": {
"type": "git",
"url": "git://github.com/uzilan/sufusku.git"
},
"license": "(MIT OR Apache-2.0)",
"dependencies": {
"bower": "^1.4.1",
"grunt": "0.4.5",
"grunt-cli": "0.1.13",
"grunt-contrib-clean": "^0.6.0",
"grunt-contrib-concat": "^0.5.1",
"grunt-contrib-connect": "^0.11.2",
"grunt-contrib-copy": "^0.8.0",
"grunt-contrib-cssmin": "^0.13.0",
"grunt-contrib-htmlmin": "^0.4.0",
"grunt-contrib-uglify": "^0.9.1",
"grunt-contrib-watch": "^0.6.1",
"grunt-ng-annotate": "^1.0.1",
"load-grunt-config": "^0.17.2",
"time-grunt": "^1.2.1"
},
"devDependencies": {},
"engines": {
"node": ">=0.8.0"
},
"scripts": {
"postinstall": "./node_modules/bower/bin/bower install && grunt build"
}
}
Gruntfile.js:
module.exports = function (grunt) {
var appname = require('./package.json').name;
require('load-grunt-config')(grunt, {
data: {
dist: 'dist/' + appname,
app: 'src',
distscripts: 'dist/' + appname + '/scripts',
diststyles: 'dist/' + appname + '/styles',
disthtml: 'dist/' + appname,
disttest: 'dist/' + appname + '/test',
appstyles: 'src/css'
}
});
require('time-grunt')(grunt);
grunt.registerTask('build', ['clean:dist', 'ngAnnotate:application', 'uglify', 'htmlmin', 'cssmin', 'copy:serve', 'concat:components']);
grunt.registerTask('serve', ['build', 'connect:livereload', 'watch']);
grunt.registerTask('default', function () {
grunt.task.run(['build']);
});
};
Heroku log:
...
heroku[web.1]: Starting process with command `npm start`
app[web.1]: npm ERR! argv "/app/.heroku/node/bin/node" "/app/.heroku/node/bin/npm" "start"
app[web.1]: npm ERR! Linux 3.13.0-57-generic
app[web.1]: npm ERR! npm v2.11.3
app[web.1]: npm ERR! missing script: start
app[web.1]: npm ERR! Please include the following file with any support request:
app[web.1]: npm ERR!
app[web.1]: npm ERR! node v0.12.7
app[web.1]:
app[web.1]: npm ERR! /app/npm-debug.log
app[web.1]: npm ERR! If you need help, you may report this error at:
app[web.1]:
app[web.1]: npm ERR! <https://github.com/npm/npm/issues>
heroku[web.1]: Process exited with status 1
heroku[web.1]: State changed from starting to crashed
heroku[web.1]: State changed from crashed to starting
heroku[web.1]: Starting process with command `npm start`
app[web.1]: npm ERR! Linux 3.13.0-57-generic
app[web.1]: npm ERR! node v0.12.7
app[web.1]:
app[web.1]: npm ERR! missing script: start
...
See Question&Answers more detail:
os