I'm trying to deploy my node.js app on Heroku which was previously deployed on NodeJitsu.
When running the git push heroku master
command, I'm getting the error message Push rejected, failed to compile Node.js app
Here is the log:
Initializing repository, done.
-----> Node.js app detected
-----> Requested node range: 0.10.x
-----> Resolved node version: 0.10.31
-----> Downloading and installing node
-----> Found existing node_modules directory; skipping cache
-----> Rebuilding any native dependencies
npm ERR! Error: ENOENT, chmod '/tmp/build_de4aabc3-909b-4768-95ab-9171c88de0cd/node_modules/jade/node_modules/mkdirp/bin/cmd.js'
npm ERR! If you need help, you may report this *entire* log,
npm ERR! including the npm and node versions, at:
npm ERR! <http://github.com/npm/npm/issues>
npm ERR! System Linux 3.8.11-ec2
npm ERR! command "/tmp/build_de4aabc3-909b-4768-95ab-9171c88de0cd/vendor/node/bin/node" "/tmp/build_de4aabc3-909b-4768-95ab-9171c88de0cd/vendor/node/bin/npm" "rebuild"
npm ERR! cwd /tmp/build_de4aabc3-909b-4768-95ab-9171c88de0cd
npm ERR! node -v v0.10.31
npm ERR! npm -v 1.4.23
npm ERR! path /tmp/build_de4aabc3-909b-4768-95ab-9171c88de0cd/node_modules/jade/node_modules/mkdirp/bin/cmd.js
npm ERR! code ENOENT
npm ERR! errno 34
npm ERR!
npm ERR! Additional logging details can be found in:
npm ERR! /tmp/build_de4aabc3-909b-4768-95ab-9171c88de0cd/npm-debug.log
npm ERR! not ok code 0
0 info it worked if it ends with ok
1 verbose cli [ '/tmp/build_de4aabc3-909b-4768-95ab-9171c88de0cd/vendor/node/bin/node',
1 verbose cli '/tmp/build_de4aabc3-909b-4768-95ab-9171c88de0cd/vendor/node/bin/npm',
1 verbose cli 'rebuild' ]
2 info using npm@1.4.23
3 info using node@v0.10.31
4 info readInstalled object
5 verbose rebuild path, id [ '/tmp/build_de4aabc3-909b-4768-95ab-9171c88de0cd',
5 verbose rebuild 'turbolister@0.1.0' ]
6 verbose rebuild path, id [ '/tmp/build_de4aabc3-909b-4768-95ab-9171c88de0cd/node_modules/async',
6 verbose rebuild 'async@0.9.0' ]
7 verbose rebuild path, id [ '/tmp/build_de4aabc3-909b-4768-95ab-9171c88de0cd/node_modules/cheerio',
7 verbose rebuild 'cheerio@0.17.0' ]
8 verbose rebuild path, id [ '/tmp/build_de4aabc3-909b-4768-95ab-9171c88de0cd/node_modules/cheerio/node_modules/CSSselect',
8 verbose rebuild 'CSSselect@0.4.1' ]
9 verbose rebuild path, id [ '/tmp/build_de4aabc3-909b-4768-95ab-9171c88de0cd/node_modules/cheerio/node_modules/CSSselect/node_modules/CSSwhat',
9 verbose rebuild 'CSSwhat@0.4.7' ]
10 verbose rebuild path, id [ '/tmp/build_de4aabc3-909b-4768-95ab-9171c88de0cd/node_modules/cheerio/node_modules/CSSselect/node_modules/domutils',
.... REMOVED LINES FOR BREVITY
722 error code ENOENT
723 error errno 34
724 verbose exit [ 34, true ]
! Push rejected, failed to compile Node.js app
To git@heroku.com:secure-retreat-3991.git
! [remote rejected] master -> master (pre-receive hook declined)
error: failed to push some refs to 'git@heroku.com:secure-retreat-3991.git'
package.json file
{
"name": "turbolister",
"version": "0.1.0",
"main": "index.js",
"scripts": {
"start": "node index.js"
},
"dependencies": {
"async": "0.9.x",
"aws-lib": "0.3.x",
"bcrypt-nodejs": "0.0.x",
"cheerio": "0.17.x",
"connect-flash": "0.1.x",
"connect-redis": "1.4.7",
"csv-stringify": "0.0.x",
"curlrequest": "^0.5.0",
"express": "3.4.x",
"express-session": "1.6.x",
"jade": "1.4.x",
"lodash": "^2.4.1",
"mongoose": "3.8.x",
"passport": "0.2.x",
"passport-local": "1.0.x",
"request": "2.37.x",
"request-replay": "latest",
"socket.io": "^1.0.6"
},
"bundleDependencies": [
"passport.socketio"
],
"engines": {
"node": "0.10.x"
}
}
.gitignore file
node_modules
!node_modules/passport.socketio
Another important thing to note, is that I want to ensure that the passport.socketio module is the one that I have within my node_modules folder and not one that is downloaded from the NPM registry.
In NodeJitsu this was achieved by using the bundleDependencies json in the package.json file, but with Heroku I'm unsure how that's done.
Looks like I had to update the version of Jade to 1.6 in the package.json file.