我尝试将我的学校项目部署到 heroku 中,但是当我键入 git push heroku master
时,我会收到以下错误:
remote: gyp ERR! build error
remote: gyp ERR! stack Error: `make` failed with exit code: 2
remote: gyp ERR! stack at ChildProcess.onExit (/tmp/build_434f42dd0dc575279023b0d76c2ad5e9/.heroku/node/lib/node_modules/npm/node_modules/node-gyp/lib/build.js:267:23)
remote: gyp ERR! stack at ChildProcess.emit (events.js:110:17)
remote: gyp ERR! stack at Process.ChildProcess._handle.onexit (child_process.js:1067:12)
remote: gyp ERR! System Linux 3.13.0-40-generic
remote: gyp ERR! command "node" "/tmp/build_434f42dd0dc575279023b0d76c2ad5e9/.heroku/node/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild"
remote: gyp ERR! cwd /tmp/build_434f42dd0dc575279023b0d76c2ad5e9/node_modules/bcrypt
remote: gyp ERR! node -v v0.12.0
remote: gyp ERR! node-gyp -v v1.0.2
remote: gyp ERR! not ok
remote:
remote: npm ERR! Linux 3.13.0-40-generic
remote: npm ERR! argv "/tmp/build_434f42dd0dc575279023b0d76c2ad5e9/.heroku/node/bin/node" "/tmp/build_434f42dd0dc575279023b0d76c2ad5e9/.heroku/node/bin/npm" "rebuild"
remote: npm ERR! node v0.12.0
remote: npm ERR! npm v2.5.1
remote: npm ERR! code ELIFECYCLE
remote: npm ERR! bcrypt@0.7.8 install: `node-gyp rebuild`
remote: npm ERR! Exit status 1
remote: npm ERR!
remote: npm ERR! Failed at the bcrypt@0.7.8 install script 'node-gyp rebuild'.
remote: npm ERR! This is most likely a problem with the bcrypt package,
remote: npm ERR! not with npm itself.
remote: npm ERR! Tell the author that this fails on your system:
remote: npm ERR! node-gyp rebuild
remote: npm ERR! You can get their info via:
remote: npm ERR! npm owner ls bcrypt
remote: npm ERR! There is likely additional logging output above.
remote:
remote: npm ERR! Please include the following file with any support request:
remote: npm ERR! /tmp/build_434f42dd0dc575279023b0d76c2ad5e9/npm-debug.log
remote:
remote: -----> Build failed
remote:
remote:
remote: We're sorry this build is failing! If you can't find the issue in application code,
remote: Love,
remote: Heroku
remote:
remote: ! Push rejected, failed to compile Node.js app
remote:
remote: Verifying deploy....
remote:
remote: ! Push rejected to cscc09-eatz.
remote:
这是我的 package.json
文件:
{
"name": "Eatz",
"version": "1.0.0",
"description": "This is CSCC09 Fall 2014 project",
"main": "app.js",
"engines":{
"node":0.10.33
},
"dependencies": {
"bcrypt": "^0.8.1",
"express": "^3.4.8",
"gm": "^1.17.0",
"mongodb": "^1.4.24",
"mongoose": "^3.8.20",
"underscore": "^1.7.0"
},
"devDependencies": {},
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
},
"repository": {
"type": "git",
"url": "https://github.com/zhengye1/CSCC09"
},
"author": "Vincent Zheng, Eliot Chow",
"license": "UTSC",
"bugs": {
"url": "https://github.com/zhengye1/CSCC09/issues"
},
}
我该如何解决这个问题?我已经尝试浏览互联网,但似乎找不到解决方案。我正在使用 Ubuntu 14.04 创建项目。
最佳答案
我认为 Heroku 在 bcrypt 中的 c++ 库存在一些问题。 我所有的努力都失败了,最后,我找到了一个替代模块 scrypt .它几乎就像 bcrypt,并且与 heroku 没有任何问题。
关于node.js - Heroku 部署失败,似乎是 bcrypt 问题,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/29088277/