Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

NPM doesn't install module dependencies when deploying a Grunt app to heroku

I'v made a static single page site using grunt. I'm now trying to deploy it to heroku using the heroku-buildpack-nodejs-grunt for node grunt.

Below is a pic of my root directory:

project root directory image

Here's my Gruntfile package.json:

Procfile:

web: node index.html

When I run $ git push heroku master it gets to the Gruntfile and fails:

-----> Found Gruntfile, running grunt heroku:production task
>> Local Npm module "grunt-contrib-uglify" not found. Is it installed?

The above errors proceed to list all local NPM modules as not found. If I list all loadNpmTasks instead of using "load-grunt-tasks", I get the exact same error.

When I $ heroku logs I get:

Starting process with command `node web.js`
Error: Cannot find module '/app/web.js'

Can anyone see where I've gone wrong?

like image 989
Callum Flack Avatar asked Dec 19 '13 12:12

Callum Flack


1 Answers

For anyone passing by here, I wasn't able to solve the problem. This is where I got to:

In my Gruntfile, I moved npm modules from devDependencies to dependencies. Heroku was then able to install these dependencies.

However, when Heroku ran the tasks, it stops at the haml task w/ error "You need to have Ruby and Haml installed and in your PATH for this task to work". Adding ruby & haml to the Gruntfile as engines did not work.

like image 74
Callum Flack Avatar answered Oct 17 '22 03:10

Callum Flack