简体   繁体   English

Nodejs 未部署在 heroku 上 - node-pre-gyp install --fallback-to-build

[英]Nodejs not deploying on heroku - node-pre-gyp install --fallback-to-build

first of all i want to establish, this is my first time experience with heroku.首先我想建立,这是我第一次使用heroku。 I have tried "git push heroku master" several times with lot of different ways.我用很多不同的方式多次尝试“git push heroku master”。 It always shows the error I mentioned in the subject.它总是显示我在主题中提到的错误。 None of heroku's troubleshooting helped me. heroku 的故障排除都没有帮助我。

following is the output after "git push heroku master"以下是“git push heroku master”之后的输出

Enumerating objects: 3914, done.
Counting objects: 100% (3914/3914), done.
Delta compression using up to 4 threads
Compressing objects: 100% (3695/3695), done.
Writing objects: 100% (3914/3914), 3.12 MiB | 492.00 KiB/s, done.
Total 3914 (delta 816), 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: NODE_ENV=production
remote: NODE_MODULES_CACHE=true
remote: NODE_VERBOSE=false
remote:
remote: -----> Installing binaries
remote: engines.node (package.json): 10.16.3
remote: engines.npm (package.json): unspecified (use default)
remote:
remote: Resolving node version 10.16.3...
remote: Downloading and installing node 10.16.3...
remote: Using default npm version: 6.9.0
remote:
remote: -----> Installing dependencies
remote: Prebuild detected (node_modules already exists)
remote: Rebuilding any native modules
remote:
remote: > bcrypt@3.0.6 install /tmp/build_fada90eccb7c7d6ba0075c19092f07ad/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@3.0.6 install: node-pre-gyp install --fallback-to-build
remote: npm ERR! Exit status 126
remote: npm ERR!
remote: npm ERR! Failed at the bcrypt@3.0.6 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! /tmp/npmcache.9MtEy/_logs/2019-09-14T11_53_20_827Z-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: 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 face-recognition-api-with-js.
remote:
To https://git.heroku.com/face-recognition-api-with-js.git
! [remote rejected] master -> master (pre-receive hook declined)
error: failed to push some refs to 'https://git.heroku.com/face-recognition-api-with-js.git'

I had exactly the same problem and the solution below helped me.我遇到了完全相同的问题,下面的解决方案帮助了我。 You probably included the node modules in your git repository, and it's better if they are out of git.您可能在 git 存储库中包含了节点模块,如果它们不在 git 中会更好。 To remove them from git, try doing:要从 git 中删除它们,请尝试执行以下操作:

$ echo 'node_modules' >> .gitignore
$ git rm -r --cached node_modules
$ git commit -am 'ignore node_modules'

Then:然后:

git add .gitignore
git commit -m "ready to deploy"
git push heroku master

For more information you can go to: https://blog.heroku.com/node-habits-2016#9-only-git-the-important-bits有关更多信息,您可以访问: https : //blog.heroku.com/node-habits-2016#9-only-git-the-important-bits

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 node-pre-gyp install --fallback-to-build - node-pre-gyp install --fallback-to-build 安装tensorflowjs节点时出错| 命令失败:node-pre-gyp install --fallback-to-build - Error while installing tensorflowjs node | Command failed: node-pre-gyp install --fallback-to-build 无法安装npm软件包-bcrypt@3.0.6 install:在Ubuntu 18.04中`node-pre-gyp install --fallback-to-build` - Couldn't install npm packages - bcrypt@3.0.6 install: `node-pre-gyp install --fallback-to-build` in Ubuntu 18.04 NPM安装上的节点预GYP安装错误 - node-pre-gyp install error on npm install bcrypt npm 安装错误 - 错误:找不到模块 node-pre-gyp\bin\node-pre-gyp - bcrypt npm install error - Error: Cannot find module node-pre-gyp\bin\node-pre-gyp 部署到Heroku node-gyp无法安装base64 @ 2.1.0,node-gyp重建失败 - Deploying into Heroku node-gyp can not install base64@2.1.0, node-gyp rebuild failed 谷歌云 Function 'node-pre-gyp/lib/pre-binding' - Google Cloud Function 'node-pre-gyp/lib/pre-binding' 如何修复 Windows 10 上 npm 模块的灌输问题,包括 node-pre-gyp? 2019年 - How to fix instillation issues with npm modules on Windows 10, including node-pre-gyp? 2019 Webpack:ERROR in ./~/sqlite3/~/node-pre-gyp/lib/node-pre-gyp.js找不到模块:错误:无法解析'file'或'directory'../package - Webpack: ERROR in ./~/sqlite3/~/node-pre-gyp/lib/node-pre-gyp.js Module not found: Error: Cannot resolve 'file' or 'directory' ../package 无法使用node-pre-gyp重建串行端口:404状态码下载64位nw.lib - Cannot rebuild serialport with node-pre-gyp: 404 status code downloading 64-bit nw.lib
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM