我尝试在之前部署在NodeJitsu上的Heroku上部署我的node.js应用程序。
运行git push heroku master
命令时,我收到错误消息Push rejected, failed to compile Node.js app
以下是日志:
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文件
{
"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文件
node_modules
!node_modules/passport.socketio
另一个需要注意的重要事项是,我想确保passport.socketio模块是我在node_modules文件夹中的模块,而不是从NPM注册表下载的模块。
在NodeJitsu中,这是通过在package.json文件中使用bundleDependencies json实现的,但是对于Heroku,我不确定它是如何完成的。
答案 0 :(得分:0)
看起来我必须在package.json文件中将Jade的版本更新为1.6。