如何用heroku发布我的api?

yiytaume  于 2021-06-21  发布在  Mysql
关注(0)|答案(0)|浏览(197)

我刚刚用nodejs+express和mysql创建了一个restapi,它在localhost中工作,但是现在我想在线使用它。
我已经测试了heroku,并创建了一个heroku应用程序,之后我做了 git push heroku master ,但我有一个权限问题:

Counting objects: 3885, done.
Delta compression using up to 4 threads.
Compressing objects: 100% (3683/3683), done.
Writing objects: 100% (3885/3885), 4.95 MiB | 76.00 KiB/s, done.
Total 3885 (delta 736), reused 0 (delta 0)
remote: Compressing source files... done.
remote: Building source:
remote:
remote: -----> Node.js app detected
remote:
remote: -----> Creating runtime environment
remote:
remote:        NPM_CONFIG_LOGLEVEL=error
remote:        NPM_CONFIG_PRODUCTION=true
remote:        NODE_VERBOSE=false
remote:        NODE_ENV=production
remote:        NODE_MODULES_CACHE=true
remote:
remote: -----> Installing binaries
remote:        engines.node (package.json):  unspecified
remote:        engines.npm (package.json):   unspecified (use default)
remote:
remote:        Resolving node version 8.x...
remote:        Downloading and installing node 8.9.4...
remote:        Using default npm version: 5.6.0
remote:
remote: -----> Restoring cache
remote:        Skipping cache restore (not-found)
remote:
remote: -----> Building dependencies
remote:        Prebuild detected (node_modules already exists)
remote:        Rebuilding any native modules
remote:
remote:        > bcrypt@1.0.3 install /tmp/build_3509cb4460806c73d75c851251539522/node_modules/bcrypt
remote:        > node-pre-gyp install --fallback-to-build
remote:
remote:        sh: 1: node-pre-gyp: Permission denied
remote:        npm ERR! code ELIFECYCLE
remote:        npm ERR! errno 126
remote:        npm ERR! bcrypt@1.0.3 install: `node-pre-gyp install --fallback-to-build`
remote:        npm ERR! Exit status 126
remote:        npm ERR!
remote:        npm ERR! Failed at the bcrypt@1.0.3 install script.
remote:        npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
remote:
remote:        npm ERR! A complete log of this run can be found in:
remote:        npm ERR!     /app/.npm/_logs/2018-01-05T20_37_55_505Z-debug.log
remote:
remote: -----> Build failed
remote:
remote:        We're sorry this build is failing! You can troubleshoot common issues here:
remote:        https://devcenter.heroku.com/articles/troubleshooting-node-deploys
remote:
remote:        Some possible problems:
remote:
remote:        - node_modules checked into source control
remote:        https://blog.heroku.com/node-habits-2016#9-only-git-the-important-bits
remote:
remote:        - Node version not specified in package.json
remote:        https://devcenter.heroku.com/articles/nodejs-support#specifying-a-node-js-version
remote:
remote:        Love,
remote:        Heroku
remote:
remote:  !     Push rejected, failed to compile Node.js app.
remote:
remote:  !     Push failed
remote: Verifying deploy...
remote:
remote: !       Push rejected to whispering-scrubland-23624.
remote:

我试过当管理员,但没什么改变。我之前也试过安装节点pre-gyp,但是没有改变什么,我还是有同样的问题。
请问你有什么办法解决这个问题吗?

暂无答案!

目前还没有任何答案,快来回答吧!

相关问题