0
我想在Heroku上部署我以前在NodeJitsu上部署的node.js應用程序。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 [email protected]
3 info using [email protected]
4 info readInstalled object
5 verbose rebuild path, id [ '/tmp/build_de4aabc3-909b-4768-95ab-9171c88de0cd',
5 verbose rebuild '[email protected]' ]
6 verbose rebuild path, id [ '/tmp/build_de4aabc3-909b-4768-95ab-9171c88de0cd/node_modules/async',
6 verbose rebuild '[email protected]' ]
7 verbose rebuild path, id [ '/tmp/build_de4aabc3-909b-4768-95ab-9171c88de0cd/node_modules/cheerio',
7 verbose rebuild '[email protected]' ]
8 verbose rebuild path, id [ '/tmp/build_de4aabc3-909b-4768-95ab-9171c88de0cd/node_modules/cheerio/node_modules/CSSselect',
8 verbose rebuild '[email protected]' ]
9 verbose rebuild path, id [ '/tmp/build_de4aabc3-909b-4768-95ab-9171c88de0cd/node_modules/cheerio/node_modules/CSSselect/node_modules/CSSwhat',
9 verbose rebuild '[email protected]' ]
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 [email protected]:secure-retreat-3991.git
! [remote rejected] master -> master (pre-receive hook declined)
error: failed to push some refs to '[email protected]: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文件夾中,沒有一個是從故宮註冊表下載。
在NodeJitsu中,這是通過在package.json文件中使用bundleDependencies json實現的,但是使用Heroku,我不確定這是如何完成的。