我使用node.js创建了我的应用程序,我需要将其推送到heroku中的存储库中,但是会收到推送失败的错误消息,其中包含了从控制台显示的错误信息。请任何可以帮助我的人
$ git push heroku master
Enumerating objects: 3928, done.
Counting objects: 100% (3928/3928), done.
Delta compression using up to 4 threads
Compressing objects: 100% (3774/3774), done.
Writing objects: 100% (3928/3928), 4.54 MiB | 153.00 KiB/s, done.
Total 3928 (delta 735), 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.15.3
remote: engines.npm (package.json): unspecified (use default)
remote:
remote: Resolving node version 10.15.3...
remote: Downloading and installing node 10.15.3...
remote: Using default npm version: 6.4.1
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_c2d2c217441a5d9a6c6d5e4798bcaba5/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.zomUn/_logs/2019-11-03T17_00_27_739Z-debug.log
remote:
remote: -----> Build failed
remote: ! Push rejected, failed to compile Node.js app.
remote:
remote: ! Push failed
remote: Verifying deploy...
答案 0 :(得分:0)
该错误是由于node_modules导致的,所以我所做的就是在我的项目终端上运行此代码
var list = context.TableC
.Include(t => t.TableACollection.Select(c => c.Col1A))
.Include(t => t.TableBCollection.Select(c => c.Col1B));
并且我设法将应用程序部署到heroku
答案 1 :(得分:0)
git rm -r --cached node_modules
git commit -m'Remove node_modules'