Heroku deployment failed, seems like bcrypt issue

为君一笑 提交于 2019-12-10 20:24:09

问题


I try to deploy my school project into heroku, but when I type git push heroku master, I will get following error"

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: 

And here is my package.json file,

{
  "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"
  },
}

How can I solve this issue? I already try to look through the Internet, but seems like I cannot find a solution for that. I am using Ubuntu 14.04 to create the project.


回答1:


Try rebuilding bcrypt.

I get the same error on mac and i fixit by rebuilding bcrypt.

npm rebuild bcrypt




回答2:


I think Heroku has some issue with c++ libraries in bcrypt. all my effort failed and finally, I found an alternative module scrypt. it's almost like bcrypt and has no issue with heroku.



来源:https://stackoverflow.com/questions/29088277/heroku-deployment-failed-seems-like-bcrypt-issue

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!