我想将一个应用程序部署到heroku。不久前它正在工作,但是当我尝试推动时,现在它给了我"推送被拒绝"。
我尝试运行node-pre-gyp安装,它告诉我我的package.json还没有准备好node-pre-gyp,告诉我:
package.json 必须声明以下属性:
主要
版本
binary.module_name
binary.module_path
二进制主机
似乎这就是问题所在,但是,我对Web开发很陌生(这是我的第一个项目(,我不知道这些属性的含义,所以我不知道如何在我的package.json中添加它们。
heroku login
git add .
git commit -m "test"
git push heroku master
这就是我通常部署代码的方式。
{
"name": "myproject",
"private": true,
"engines": {
"node": "8.10.0"
},
"scripts": {
"start": "meteor run",
"test": "meteor test --once --driver-package meteortesting:mocha",
"test-app": "TEST_WATCH=1 meteor test --full-app --driver-package meteortesting:mocha",
"visualize": "meteor --production --extra-packages bundle-visualizer"
},
"dependencies": {
"@babel/runtime": "^7.6.0",
"bcrypt": "^3.0.0",
"bcryptjs": "^2.4.3",
"meteor-node-stubs": "^0.4.1",
"node-pre-gyp": "0.13.0"
},
"meteor": {
"mainModule": {
"client": "client/main.js",
"server": "server/main.js"
},
"testModule": "tests/main.js"
}
}
这是我的包.json。
remote: regexpu-core@4.4.0 /tmp/build_be7761c4e5b001e1b5dbfe1536cb4eec/.meteor/heroku_build/app/programs/server/npm/node_modules/meteor/babel-compiler/node_modules/regexpu-core
remote: regenerate@1.4.0 /tmp/build_be7761c4e5b001e1b5dbfe1536cb4eec/.meteor/heroku_build/app/programs/server/npm/node_modules/meteor/babel-compiler/node_modules/regenerate
remote: regenerate-unicode-properties@7.0.0 /tmp/build_be7761c4e5b001e1b5dbfe1536cb4eec/.meteor/heroku_build/app/programs/server/npm/node_modules/meteor/babel-compiler/node_modules/regenerate-unicode-properties
remote: regjsgen@0.5.0 /tmp/build_be7761c4e5b001e1b5dbfe1536cb4eec/.meteor/heroku_build/app/programs/server/npm/node_modules/meteor/babel-compiler/node_modules/regjsgen
remote: regjsparser@0.6.0 /tmp/build_be7761c4e5b001e1b5dbfe1536cb4eec/.meteor/heroku_build/app/programs/server/npm/node_modules/meteor/babel-compiler/node_modules/regjsparser
remote: jsesc@0.5.0 /tmp/build_be7761c4e5b001e1b5dbfe1536cb4eec/.meteor/heroku_build/app/programs/server/npm/node_modules/meteor/babel-compiler/node_modules/regjsparser/node_modules/jsesc
remote: unicode-match-property-ecmascript@1.0.4 /tmp/build_be7761c4e5b001e1b5dbfe1536cb4eec/.meteor/heroku_build/app/programs/server/npm/node_modules/meteor/babel-compiler/node_modules/unicode-match-property-ecmascript
remote: unicode-canonical-property-names-ecmascript@1.0.4 /tmp/build_be7761c4e5b001e1b5dbfe1536cb4eec/.meteor/heroku_build/app/programs/server/npm/node_modules/meteor/babel-compiler/node_modules/unicode-canonical-property-names-ecmascript
remote: unicode-property-aliases-ecmascript@1.0.4 /tmp/build_be7761c4e5b001e1b5dbfe1536cb4eec/.meteor/heroku_build/app/programs/server/npm/node_modules/meteor/babel-compiler/node_modules/unicode-property-aliases-ecmascript
remote: unicode-match-property-value-ecmascript@1.0.2 /tmp/build_be7761c4e5b001e1b5dbfe1536cb4eec/.meteor/heroku_build/app/programs/server/npm/node_modules/meteor/babel-compiler/node_modules/unicode-match-property-value-ecmascript
remote: @babel/preset-react@7.0.0 /tmp/build_be7761c4e5b001e1b5dbfe1536cb4eec/.meteor/heroku_build/app/programs/server/npm/node_modules/meteor/babel-compiler/node_modules/@babel/preset-react
remote: @babel/runtime@7.3.4 /tmp/build_be7761c4e5b001e1b5dbfe1536cb4eec/.meteor/heroku_build/app/programs/server/npm/node_modules/meteor/babel-compiler/node_modules/@babel/runtime
remote: regenerator-runtime@0.12.1 /tmp/build_be7761c4e5b001e1b5dbfe1536cb4eec/.meteor/heroku_build/app/programs/server/npm/node_modules/meteor/babel-compiler/node_modules/regenerator-runtime
remote: acorn@5.7.3 /tmp/build_be7761c4e5b001e1b5dbfe1536cb4eec/.meteor/heroku_build/app/programs/server/npm/node_modules/meteor/babel-compiler/node_modules/acorn
remote: babel-helper-evaluate-path@0.5.0 /tmp/build_be7761c4e5b001e1b5dbfe1536cb4eec/.meteor/heroku_build/app/programs/server/npm/node_modules/meteor/babel-compiler/node_modules/babel-helper-evaluate-path
remote: babel-helper-flip-expressions@0.4.3 /tmp/build_be7761c4e5b001e1b5dbfe1536cb4eec/.meteor/heroku_build/app/programs/server/npm/node_modules/meteor/babel-compiler/node_modules/babel-helper-flip-expressions
remote: babel-helper-is-nodes-equiv@0.0.1 /tmp/build_be7761c4e5b001e1b5dbfe1536cb4eec/.meteor/heroku_build/app/programs/server/npm/node_modules/meteor/babel-compiler/node_modules/babel-helper-is-nodes-equiv
remote: babel-helper-is-void-0@0.4.3 /tmp/build_be7761c4e5b001e1b5dbfe1536cb4eec/.meteor/heroku_build/app/programs/server/npm/node_modules/meteor/babel-compiler/node_modules/babel-helper-is-void-0
remote: babel-helper-mark-eval-scopes@0.4.3 /tmp/build_be7761c4e5b001e1b5dbfe1536cb4eec/.meteor/heroku_build/app/programs/server/npm/node_modules/meteor/babel-compiler/node_modules/babel-helper-mark-eval-scopes
remote: babel-helper-remove-or-void@0.4.3 /tmp/build_be7761c4e5b001e1b5dbfe1536cb4eec/.meteor/heroku_build/app/programs/server/npm/node_modules/meteor/babel-compiler/node_modules/babel-helper-remove-or-void
remote: babel-helper-to-multiple-sequence-expressions@0.5.0 /tmp/build_be7761c4e5b001e1b5dbfe1536cb4eec/.meteor/heroku_build/app/programs/server/npm/node_modules/meteor/babel-compiler/node_modules/babel-helper-to-multiple-sequence-expressions
remote: babel-plugin-minify-builtins@0.5.0 /tmp/build_be7761c4e5b001e1b5dbfe1536cb4eec/.meteor/heroku_build/app/programs/server/npm/node_modules/meteor/babel-compiler/node_modules/babel-plugin-minify-builtins
remote: babel-plugin-minify-constant-folding@0.5.0 /tmp/build_be7761c4e5b001e1b5dbfe1536cb4eec/.meteor/heroku_build/app/programs/server/npm/node_modules/meteor/babel-compiler/node_modules/babel-plugin-minify-constant-folding
remote: babel-plugin-minify-dead-code-elimination@0.5.0 /tmp/build_be7761c4e5b001e1b5dbfe1536cb4eec/.meteor/heroku_build/app/programs/server/npm/node_modules/meteor/babel-compiler/node_modules/babel-plugin-minify-dead-code-elimination
remote: lodash.some@4.6.0 /tmp/build_be7761c4e5b001e1b5dbfe1536cb4eec/.meteor/heroku_build/app/programs/server/npm/node_modules/meteor/babel-compiler/node_modules/lodash.some
remote: babel-plugin-minify-flip-comparisons@0.4.3 /tmp/build_be7761c4e5b001e1b5dbfe1536cb4eec/.meteor/heroku_build/app/programs/server/npm/node_modules/meteor/babel-compiler/node_modules/babel-plugin-minify-flip-comparisons
remote: babel-plugin-minify-guarded-expressions@0.4.3 /tmp/build_be7761c4e5b001e1b5dbfe1536cb4eec/.meteor/heroku_build/app/programs/server/npm/node_modules/meteor/babel-compiler/node_modules/babel-plugin-minify-guarded-expressions
remote: babel-plugin-minify-infinity@0.4.3 /tmp/build_be7761c4e5b001e1b5dbfe1536cb4eec/.meteor/heroku_build/app/programs/server/npm/node_modules/meteor/babel-compiler/node_modules/babel-plugin-minify-infinity
remote: babel-plugin-minify-mangle-names@0.5.0 /tmp/build_be7761c4e5b001e1b5dbfe1536cb4eec/.meteor/heroku_build/app/programs/server/npm/node_modules/meteor/babel-compiler/node_modules/babel-plugin-minify-mangle-names
remote: babel-plugin-minify-numeric-literals@0.4.3 /tmp/build_be7761c4e5b001e1b5dbfe1536cb4eec/.meteor/heroku_build/app/programs/server/npm/node_modules/meteor/babel-compiler/node_modules/babel-plugin-minify-numeric-literals
remote: babel-plugin-minify-replace@0.5.0 /tmp/build_be7761c4e5b001e1b5dbfe1536cb4eec/.meteor/heroku_build/app/programs/server/npm/node_modules/meteor/babel-compiler/node_modules/babel-plugin-minify-replace
remote: babel-plugin-minify-simplify@0.5.0 /tmp/build_be7761c4e5b001e1b5dbfe1536cb4eec/.meteor/heroku_build/app/programs/server/npm/node_modules/meteor/babel-compiler/node_modules/babel-plugin-minify-simplify
remote: babel-plugin-minify-type-constructors@0.4.3 /tmp/build_be7761c4e5b001e1b5dbfe1536cb4eec/.meteor/heroku_build/app/programs/server/npm/node_modules/meteor/babel-compiler/node_modules/babel-plugin-minify-type-constructors
remote: babel-plugin-transform-es2015-modules-reify@0.18.0 /tmp/build_be7761c4e5b001e1b5dbfe1536cb4eec/.meteor/heroku_build/app/programs/server/npm/node_modules/meteor/babel-compiler/node_modules/babel-plugin-transform-es2015-modules-reify
remote: reify@0.18.1 /tmp/build_be7761c4e5b001e1b5dbfe1536cb4eec/.meteor/heroku_build/app/programs/server/npm/node_modules/meteor/babel-compiler/node_modules/babel-plugin-transform-es2015-modules-reify/node_modules/reify
remote: babel-plugin-transform-inline-consecutive-adds@0.4.3 /tmp/build_be7761c4e5b001e1b5dbfe1536cb4eec/.meteor/heroku_build/app/programs/server/npm/node_modules/meteor/babel-compiler/node_modules/babel-plugin-transform-inline-consecutive-adds
remote: babel-plugin-transform-member-expression-literals@6.9.4 /tmp/build_be7761c4e5b001e1b5dbfe1536cb4eec/.meteor/heroku_build/app/programs/server/npm/node_modules/meteor/babel-compiler/node_modules/babel-plugin-transform-member-expression-literals
remote: babel-plugin-transform-merge-sibling-variables@6.9.4 /tmp/build_be7761c4e5b001e1b5dbfe1536cb4eec/.meteor/heroku_build/app/programs/server/npm/node_modules/meteor/babel-compiler/node_modules/babel-plugin-transform-merge-sibling-variables
remote: babel-plugin-transform-minify-booleans@6.9.4 /tmp/build_be7761c4e5b001e1b5dbfe1536cb4eec/.meteor/heroku_build/app/programs/server/npm/node_modules/meteor/babel-compiler/node_modules/babel-plugin-transform-minify-booleans
remote: babel-plugin-transform-property-literals@6.9.4 /tmp/build_be7761c4e5b001e1b5dbfe1536cb4eec/.meteor/heroku_build/app/programs/server/npm/node_modules/meteor/babel-compiler/node_modules/babel-plugin-transform-property-literals
remote: babel-plugin-transform-regexp-constructors@0.4.3 /tmp/build_be7761c4e5b001e1b5dbfe1536cb4eec/.meteor/heroku_build/app/programs/server/npm/node_modules/meteor/babel-compiler/node_modules/babel-plugin-transform-regexp-constructors
remote: babel-plugin-transform-remove-console@6.9.4 /tmp/build_be7761c4e5b001e1b5dbfe1536cb4eec/.meteor/heroku_build/app/programs/server/npm/node_modules/meteor/babel-compiler/node_modules/babel-plugin-transform-remove-console
remote: babel-plugin-transform-remove-debugger@6.9.4 /tmp/build_be7761c4e5b001e1b5dbfe1536cb4eec/.meteor/heroku_build/app/programs/server/npm/node_modules/meteor/babel-compiler/node_modules/babel-plugin-transform-remove-debugger
remote: babel-plugin-transform-remove-undefined@0.5.0 /tmp/build_be7761c4e5b001e1b5dbfe1536cb4eec/.meteor/heroku_build/app/programs/server/npm/node_modules/meteor/babel-compiler/node_modules/babel-plugin-transform-remove-undefined
remote: babel-plugin-transform-simplify-comparison-operators@6.9.4 /tmp/build_be7761c4e5b001e1b5dbfe1536cb4eec/.meteor/heroku_build/app/programs/server/npm/node_modules/meteor/babel-compiler/node_modules/babel-plugin-transform-simplify-comparison-operators
remote: babel-plugin-transform-undefined-to-void@6.9.4 /tmp/build_be7761c4e5b001e1b5dbfe1536cb4eec/.meteor/heroku_build/app/programs/server/npm/node_modules/meteor/babel-compiler/node_modules/babel-plugin-transform-undefined-to-void
remote: babel-preset-meteor@7.3.4 /tmp/build_be7761c4e5b001e1b5dbfe1536cb4eec/.meteor/heroku_build/app/programs/server/npm/node_modules/meteor/babel-compiler/node_modules/babel-preset-meteor
remote: babel-preset-minify@0.5.0 /tmp/build_be7761c4e5b001e1b5dbfe1536cb4eec/.meteor/heroku_build/app/programs/server/npm/node_modules/meteor/babel-compiler/node_modules/babel-preset-minify
remote: lodash.isplainobject@4.0.6 /tmp/build_be7761c4e5b001e1b5dbfe1536cb4eec/.meteor/heroku_build/app/programs/server/npm/node_modules/meteor/babel-compiler/node_modules/lodash.isplainobject
remote: json5@2.1.0 /tmp/build_be7761c4e5b001e1b5dbfe1536cb4eec/.meteor/heroku_build/app/programs/server/npm/node_modules/meteor/babel-compiler/node_modules/json5
remote: meteor-babel@7.3.4 /tmp/build_be7761c4e5b001e1b5dbfe1536cb4eec/.meteor/heroku_build/app/programs/server/npm/node_modules/meteor/babel-compiler/node_modules/meteor-babel
remote: meteor-babel-helpers@0.0.3 /tmp/build_be7761c4e5b001e1b5dbfe1536cb4eec/.meteor/heroku_build/app/programs/server/npm/node_modules/meteor/babel-compiler/node_modules/meteor-babel-helpers
remote: reify@0.17.3 /tmp/build_be7761c4e5b001e1b5dbfe1536cb4eec/.meteor/heroku_build/app/programs/server/npm/node_modules/meteor/babel-compiler/node_modules/reify
remote:
remote: > bcrypt@3.0.0 install /tmp/build_be7761c4e5b001e1b5dbfe1536cb4eec/.meteor/heroku_build/app/programs/server/npm/node_modules/bcrypt
remote: > node-pre-gyp install --fallback-to-build
remote:
remote: node-pre-gyp WARN Pre-built binaries not installable for bcrypt@3.0.0 and node@8.15.1 (node-v57 ABI, glibc) (falling back to source compile with node-gyp)
remote: node-pre-gyp WARN Hit error Remote end closed socket abruptly.
remote: node-pre-gyp WARN Pre-built binaries not installable for bcrypt@3.0.0 and node@8.15.1 (node-v57 ABI, glibc) (falling back to source compile with node-gyp)
remote: node-pre-gyp WARN Hit error bad download
remote: make: Entering directory '/tmp/build_be7761c4e5b001e1b5dbfe1536cb4eec/.meteor/heroku_build/app/programs/server/npm/node_modules/bcrypt/build'
remote: make: Entering directory '/tmp/build_be7761c4e5b001e1b5dbfe1536cb4eec/.meteor/heroku_build/app/programs/server/npm/node_modules/bcrypt/build'
remote: CXX(target) Release/obj.target/bcrypt_lib/src/blowfish.o
remote: CXX(target) Release/obj.target/bcrypt_lib/src/blowfish.o
remote: rm: cannot remove './Release/.deps/Release/obj.target/bcrypt_lib/src/blowfish.o.d.raw': No such file or directory
remote: bcrypt_lib.target.mk:103: recipe for target 'Release/obj.target/bcrypt_lib/src/blowfish.o' failed
remote: make: *** [Release/obj.target/bcrypt_lib/src/blowfish.o] Error 1
remote: make: Leaving directory '/tmp/build_be7761c4e5b001e1b5dbfe1536cb4eec/.meteor/heroku_build/app/programs/server/npm/node_modules/bcrypt/build'
remote: CXX(target) Release/obj.target/bcrypt_lib/src/bcrypt.o
remote: gyp ERR! build error
remote: gyp ERR! stack Error: `make` failed with exit code: 2
remote: gyp ERR! stack at ChildProcess.onExit (/app/tmp/cache/meteor/.meteor/packages/meteor-tool/.1.8.1.1sak1mc.c14s++os.linux.x86_64+web.browser+web.browser.legacy+web.cordova/mt-os.linux.x86_64/dev_bundle/lib/node_modules/npm/node_modules/node-gyp/lib/build.js:262:23)
remote: gyp ERR! stack at emitTwo (events.js:126:13)
remote: gyp ERR! stack at ChildProcess.emit (events.js:214:7)
remote: gyp ERR! stack at Process.ChildProcess._handle.onexit (internal/child_process.js:198:12)
remote: gyp ERR! System Linux 4.4.0-1048-aws
remote: gyp ERR! command "/app/tmp/cache/meteor/.meteor/packages/meteor-tool/.1.8.1.1sak1mc.c14s++os.linux.x86_64+web.browser+web.browser.legacy+web.cordova/mt-os.linux.x86_64/dev_bundle/bin/node" "/app/tmp/cache/meteor/.meteor/packages/meteor-tool/.1.8.1.1sak1mc.c14s++os.linux.x86_64+web.browser+web.browser.legacy+web.cordova/mt-os.linux.x86_64/dev_bundle/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "build" "--fallback-to-build" "--module=/tmp/build_be7761c4e5b001e1b5dbfe1536cb4eec/.meteor/heroku_build/app/programs/server/npm/node_modules/bcrypt/lib/binding/bcrypt_lib.node" "--module_name=bcrypt_lib" "--module_path=/tmp/build_be7761c4e5b001e1b5dbfe1536cb4eec/.meteor/heroku_build/app/programs/server/npm/node_modules/bcrypt/lib/binding" "--napi_version=3" "--node_abi_napi=napi"
remote: gyp ERR! cwd /tmp/build_be7761c4e5b001e1b5dbfe1536cb4eec/.meteor/heroku_build/app/programs/server/npm/node_modules/bcrypt
remote: gyp ERR! node -v v8.15.1
remote: gyp ERR! node-gyp -v v3.8.0
remote: gyp ERR! not ok
remote: node-pre-gyp ERR! build error
remote: node-pre-gyp ERR! stack Error: Failed to execute '/app/tmp/cache/meteor/.meteor/packages/meteor-tool/.1.8.1.1sak1mc.c14s++os.linux.x86_64+web.browser+web.browser.legacy+web.cordova/mt-os.linux.x86_64/dev_bundle/bin/node /app/tmp/cache/meteor/.meteor/packages/meteor-tool/.1.8.1.1sak1mc.c14s++os.linux.x86_64+web.browser+web.browser.legacy+web.cordova/mt-os.linux.x86_64/dev_bundle/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js build --fallback-to-build --module=/tmp/build_be7761c4e5b001e1b5dbfe1536cb4eec/.meteor/heroku_build/app/programs/server/npm/node_modules/bcrypt/lib/binding/bcrypt_lib.node --module_name=bcrypt_lib --module_path=/tmp/build_be7761c4e5b001e1b5dbfe1536cb4eec/.meteor/heroku_build/app/programs/server/npm/node_modules/bcrypt/lib/binding --napi_version=3 --node_abi_napi=napi' (1)
remote: node-pre-gyp ERR! stack at ChildProcess.<anonymous> (/tmp/build_be7761c4e5b001e1b5dbfe1536cb4eec/.meteor/heroku_build/app/programs/server/npm/node_modules/bcrypt/node_modules/node-pre-gyp/lib/util/compile.js:83:29)
remote: node-pre-gyp ERR! stack at emitTwo (events.js:126:13)
remote: node-pre-gyp ERR! stack at ChildProcess.emit (events.js:214:7)
remote: node-pre-gyp ERR! stack at maybeClose (internal/child_process.js:915:16)
remote: node-pre-gyp ERR! stack at Process.ChildProcess._handle.onexit (internal/child_process.js:209:5)
remote: node-pre-gyp ERR! System Linux 4.4.0-1048-aws
remote: node-pre-gyp ERR! command "/app/tmp/cache/meteor/.meteor/packages/meteor-tool/.1.8.1.1sak1mc.c14s++os.linux.x86_64+web.browser+web.browser.legacy+web.cordova/mt-os.linux.x86_64/dev_bundle/bin/node" "/tmp/build_be7761c4e5b001e1b5dbfe1536cb4eec/.meteor/heroku_build/app/programs/server/npm/node_modules/bcrypt/node_modules/.bin/node-pre-gyp" "install" "--fallback-to-build"
remote: node-pre-gyp ERR! cwd /tmp/build_be7761c4e5b001e1b5dbfe1536cb4eec/.meteor/heroku_build/app/programs/server/npm/node_modules/bcrypt
remote: node-pre-gyp ERR! node -v v8.15.1
remote: node-pre-gyp ERR! node-pre-gyp -v v0.10.2
remote: node-pre-gyp ERR! not ok
remote: Failed to execute '/app/tmp/cache/meteor/.meteor/packages/meteor-tool/.1.8.1.1sak1mc.c14s++os.linux.x86_64+web.browser+web.browser.legacy+web.cordova/mt-os.linux.x86_64/dev_bundle/bin/node /app/tmp/cache/meteor/.meteor/packages/meteor-tool/.1.8.1.1sak1mc.c14s++os.linux.x86_64+web.browser+web.browser.legacy+web.cordova/mt-os.linux.x86_64/dev_bundle/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js build --fallback-to-build --module=/tmp/build_be7761c4e5b001e1b5dbfe1536cb4eec/.meteor/heroku_build/app/programs/server/npm/node_modules/bcrypt/lib/binding/bcrypt_lib.node --module_name=bcrypt_lib --module_path=/tmp/build_be7761c4e5b001e1b5dbfe1536cb4eec/.meteor/heroku_build/app/programs/server/npm/node_modules/bcrypt/lib/binding --napi_version=3 --node_abi_napi=napi' (1)
remote: npm ERR! code ELIFECYCLE
remote: npm ERR! errno 1
remote: npm ERR! bcrypt@3.0.0 install: `node-pre-gyp install --fallback-to-build`
remote: npm ERR! Exit status 1
remote: npm ERR!
remote: npm ERR! Failed at the bcrypt@3.0.0 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/2019-09-08T15_17_16_793Z-debug.log
remote: npm ERR! code ELIFECYCLE
remote: npm ERR! errno 1
remote: npm ERR! meteor-dev-bundle@ install: `node npm-rebuild.js`
remote: npm ERR! Exit status 1
remote: npm ERR!
remote: npm ERR! Failed at the meteor-dev-bundle@ 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/2019-09-08T15_17_16_852Z-debug.log
remote: make: *** wait: No child processes. Stop.
remote: make: *** Waiting for unfinished jobs....
remote: make: *** wait: No child processes. Stop.
remote: ! Push rejected, failed to compile Node.js app.
remote:
remote: ! Push failed
remote: Verifying deploy...
remote:
remote: ! Push rejected to frozenfruits.
remote:
To https://git.heroku.com/frozenfruits.git
! [remote rejected] master -> master (pre-receive hook declined)
error: failed to push some refs to 'https://git.heroku.com/frozenfruits.git'
这是我运行 git push heroku master 时的错误日志。
从错误向后工作,错误日志中的关键行是:
remote: npm ERR! Failed at the bcrypt@3.0.0 install script.
这告诉我们bcrypt的安装脚本是罪魁祸首(不是你的应用程序代码(
remote: gyp ERR! stack Error: `make` failed with exit code: 2
这显示了node-gyp
运行时的错误make
用于将本机插件编译到节点。 和:
remote: node-pre-gyp WARN Pre-built binaries not installable for bcrypt@3.0.0 and node@8.15.1 (node-v57 ABI, glibc) (falling back to source compile with node-gyp)
这告诉我们,node-pre-gyp
最初试图下载预构建的bcrypt版本,以节省编译的麻烦,但失败了,因为节点8没有预构建的bcrypt 3版本。
这意味着如果我们找到适用于节点版本的 bcrypt 版本,我们应该很好! 版本兼容性表告诉我们:
| Node Version | bcrypt Version |
| ------------ |:--------------:|
| 8 | >= 1.0.3 |
| 10, 11 | >= 3 |
所以你想要一个介于 1.0.3 和 3.0.0 之间的 bcrypt 版本。
查看 npm 上的版本选项卡,我们看到适合的最新版本是2.0.1
因此,您想将package.json
中的版本更改为 2.0.1:
"dependencies": {
"bcrypt": "^2.0.1",
... etc
当你使用它时,如果你使用bcrypt
,你可能应该删除bcryptjs
,node-pre-gyp
,因为你的实际应用程序不太可能在生产中使用它。
事实上,这就是为什么node-pre-gyp install
告诉你你还没有"节点预 gyp 就绪",只需删除node-pre-gyp