0

我想为工作创建和定制一个内部移动设备结账系统(以更好地保持库存)。我在 GitHub 上找到了这个项目,看起来我可以使用它的设计模式作为我系统的框架。

问题是,在我将它分叉并尝试在 Heroku 上发布之后,我不断收到部署错误。不确定这个项目是否损坏,或者我缺少什么。我也对其他使用 JS 和 MongoDB 的 github 存储库持开放态度。

任何帮助表示赞赏

项目: https ://intense-scrubland-74617.herokuapp.com/https://intense-scrubland-74617.herokuapp.com/

Heroku 显示的部署错误:

    -----> Node.js app detected

    -----> Creating runtime environment

           NPM_CONFIG_LOGLEVEL=error
           NODE_ENV=production
           NODE_MODULES_CACHE=true
           NODE_VERBOSE=false

    -----> Installing binaries
           engines.node (package.json):  unspecified
           engines.npm (package.json):   unspecified (use default)

           Resolving node version 12.x...
           Downloading and installing node 12.16.2...
           Using default npm version: 6.14.4

    -----> Installing dependencies
           Installing node modules (package.json)

           > bcrypt@1.0.3 install /tmp/build_a348ac309513585e6a80cd4583b613dc/node_modules/bcrypt
           > node-pre-gyp install --fallback-to-build

           node-pre-gyp ERR! Tried to download(404): https://github.com/kelektiv/node.bcrypt.js/releases/download/v1.0.3/bcrypt_lib-v1.0.3-node-v72-linux-x64.tar.gz 
           node-pre-gyp ERR! Pre-built binaries not found for bcrypt@1.0.3 and node@12.16.2 (node-v72 ABI) (falling back to source compile with node-gyp) 
           node-pre-gyp ERR! Tried to download(undefined): https://github.com/kelektiv/node.bcrypt.js/releases/download/v1.0.3/bcrypt_lib-v1.0.3-node-v72-linux-x64.tar.gz 
           node-pre-gyp ERR! Pre-built binaries not found for bcrypt@1.0.3 and node@12.16.2 (node-v72 ABI) (falling back to source compile with node-gyp) 
           make: Entering directory '/tmp/build_a348ac309513585e6a80cd4583b613dc/node_modules/bcrypt/build'
             CXX(target) Release/obj.target/bcrypt_lib/src/blowfish.o
           make: Entering directory '/tmp/build_a348ac309513585e6a80cd4583b613dc/node_modules/bcrypt/build'
             CXX(target) Release/obj.target/bcrypt_lib/src/blowfish.o
           sed: can't read ./Release/.deps/Release/obj.target/bcrypt_lib/src/blowfish.o.d.raw: No such file or directory
           rm: cannot remove './Release/.deps/Release/obj.target/bcrypt_lib/src/blowfish.o.d.raw': No such file or directory
           bcrypt_lib.target.mk:113: recipe for target 'Release/obj.target/bcrypt_lib/src/blowfish.o' failed
           make: *** [Release/obj.target/bcrypt_lib/src/blowfish.o] Error 1
           make: Leaving directory '/tmp/build_a348ac309513585e6a80cd4583b613dc/node_modules/bcrypt/build'
             CXX(target) Release/obj.target/bcrypt_lib/src/bcrypt.o
           gyp ERR! build error 
           gyp ERR! stack Error: `make` failed with exit code: 2
           gyp ERR! stack     at ChildProcess.onExit (/tmp/build_a348ac309513585e6a80cd4583b613dc/.heroku/node/lib/node_modules/npm/node_modules/node-gyp/lib/build.js:194:23)
           gyp ERR! stack     at ChildProcess.emit (events.js:310:20)
           gyp ERR! stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:275:12)
           gyp ERR! System Linux 4.4.0-1062-aws
           gyp ERR! command "/tmp/build_a348ac309513585e6a80cd4583b613dc/.heroku/node/bin/node" "/tmp/build_a348ac309513585e6a80cd4583b613dc/.heroku/node/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "build" "--fallback-to-build" "--module=/tmp/build_a348ac309513585e6a80cd4583b613dc/node_modules/bcrypt/lib/binding/bcrypt_lib.node" "--module_name=bcrypt_lib" "--module_path=/tmp/build_a348ac309513585e6a80cd4583b613dc/node_modules/bcrypt/lib/binding"
           gyp ERR! cwd /tmp/build_a348ac309513585e6a80cd4583b613dc/node_modules/bcrypt
           gyp ERR! node -v v12.16.2
           gyp ERR! node-gyp -v v5.1.0
           gyp ERR! not ok 
           node-pre-gyp ERR! build error 
           node-pre-gyp ERR! stack Error: Failed to execute '/tmp/build_a348ac309513585e6a80cd4583b613dc/.heroku/node/bin/node /tmp/build_a348ac309513585e6a80cd4583b613dc/.heroku/node/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js build --fallback-to-build --module=/tmp/build_a348ac309513585e6a80cd4583b613dc/node_modules/bcrypt/lib/binding/bcrypt_lib.node --module_name=bcrypt_lib --module_path=/tmp/build_a348ac309513585e6a80cd4583b613dc/node_modules/bcrypt/lib/binding' (1)
           node-pre-gyp ERR! stack     at ChildProcess.<anonymous> (/tmp/build_a348ac309513585e6a80cd4583b613dc/node_modules/node-pre-gyp/lib/util/compile.js:83:29)
           node-pre-gyp ERR! stack     at ChildProcess.emit (events.js:310:20)
           node-pre-gyp ERR! stack     at maybeClose (internal/child_process.js:1021:16)
           node-pre-gyp ERR! stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:286:5)
           node-pre-gyp ERR! System Linux 4.4.0-1062-aws
           node-pre-gyp ERR! command "/tmp/build_a348ac309513585e6a80cd4583b613dc/.heroku/node/bin/node" "/tmp/build_a348ac309513585e6a80cd4583b613dc/node_modules/.bin/node-pre-gyp" "install" "--fallback-to-build"
           node-pre-gyp ERR! cwd /tmp/build_a348ac309513585e6a80cd4583b613dc/node_modules/bcrypt
           node-pre-gyp ERR! node -v v12.16.2
           node-pre-gyp ERR! node-pre-gyp -v v0.6.36
           node-pre-gyp ERR! not ok 
           Failed to execute '/tmp/build_a348ac309513585e6a80cd4583b613dc/.heroku/node/bin/node /tmp/build_a348ac309513585e6a80cd4583b613dc/.heroku/node/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js build --fallback-to-build --module=/tmp/build_a348ac309513585e6a80cd4583b613dc/node_modules/bcrypt/lib/binding/bcrypt_lib.node --module_name=bcrypt_lib --module_path=/tmp/build_a348ac309513585e6a80cd4583b613dc/node_modules/bcrypt/lib/binding' (1)
           ../src/bcrypt.cc: In function ‘void encode_salt(char*, u_int8_t*, u_int16_t, u_int8_t)’:
           ../src/bcrypt.cc:132:1: warning: ‘__builtin___snprintf_chk’ output may be truncated before the last format character [-Wformat-truncation=]
            encode_salt(char *salt, u_int8_t *csalt, u_int16_t clen, u_int8_t logr)
            ^~~~~~~~~~~
           In file included from /usr/include/stdio.h:862:0,
                            from ../src/bcrypt.cc:48:
           /usr/include/x86_64-linux-gnu/bits/stdio2.h:65:44: note: ‘__builtin___snprintf_chk’ output between 4 and 5 bytes into a destination of size 4
                   __bos (__s), __fmt, __va_arg_pack ());
                                                       ^
           ../src/bcrypt.cc: In function ‘void bcrypt(const char*, const char*, char*)’:
           ../src/bcrypt.cc:165:1: warning: ‘__builtin___snprintf_chk’ output may be truncated before the last format character [-Wformat-truncation=]
            bcrypt(const char *key, const char *salt, char *encrypted)
            ^~~~~~
           In file included from /usr/include/stdio.h:862:0,
                            from ../src/bcrypt.cc:48:
           /usr/include/x86_64-linux-gnu/bits/stdio2.h:65:44: note: ‘__builtin___snprintf_chk’ output between 4 and 5 bytes into a destination of size 4
                   __bos (__s), __fmt, __va_arg_pack ());
                                                       ^
           touch: cannot touch './Release/.deps/Release/obj.target/bcrypt_lib/src/bcrypt.o.d.raw': No such file or directory
           bcrypt_lib.target.mk:113: recipe for target 'Release/obj.target/bcrypt_lib/src/bcrypt.o' failed
           make: *** [Release/obj.target/bcrypt_lib/src/bcrypt.o] Error 1
           make: Leaving directory '/tmp/build_a348ac309513585e6a80cd4583b613dc/node_modules/bcrypt/build'
           gyp ERR! build error 
           gyp ERR! stack Error: `make` failed with exit code: 2
           gyp ERR! stack     at ChildProcess.onExit (/tmp/build_a348ac309513585e6a80cd4583b613dc/.heroku/node/lib/node_modules/npm/node_modules/node-gyp/lib/build.js:194:23)
           gyp ERR! stack     at ChildProcess.emit (events.js:310:20)
           gyp ERR! stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:275:12)
           gyp ERR! System Linux 4.4.0-1062-aws
           gyp ERR! command "/tmp/build_a348ac309513585e6a80cd4583b613dc/.heroku/node/bin/node" "/tmp/build_a348ac309513585e6a80cd4583b613dc/.heroku/node/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "build" "--fallback-to-build" "--module=/tmp/build_a348ac309513585e6a80cd4583b613dc/node_modules/bcrypt/lib/binding/bcrypt_lib.node" "--module_name=bcrypt_lib" "--module_path=/tmp/build_a348ac309513585e6a80cd4583b613dc/node_modules/bcrypt/lib/binding"
           gyp ERR! cwd /tmp/build_a348ac309513585e6a80cd4583b613dc/node_modules/bcrypt
           gyp ERR! node -v v12.16.2
           gyp ERR! node-gyp -v v5.1.0
           gyp ERR! not ok 
           npm ERR! code ELIFECYCLE
           npm ERR! errno 1
           npm ERR! bcrypt@1.0.3 install: `node-pre-gyp install --fallback-to-build`
           npm ERR! Exit status 1
           npm ERR! 
           npm ERR! Failed at the bcrypt@1.0.3 install script.
           npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

           npm ERR! A complete log of this run can be found in:
           npm ERR!     /tmp/npmcache.3bDXq/_logs/2020-04-27T01_49_47_939Z-debug.log
    -----> Build failed

           We're sorry this build is failing! You can troubleshoot common issues here:
           https://devcenter.heroku.com/articles/troubleshooting-node-deploys

           Some possible problems:

           - Node version not specified in package.json
             https://devcenter.heroku.com/articles/nodejs-support#specifying-a-node-js-version

           Love,
           Heroku

     !     Push rejected, failed to compile Node.js app.
     !     Push failed 

看看怎么样

4

1 回答 1

0

您正在安装两个不兼容的软件包。

下载安装节点 12.16.2...
...
> bcrypt@1.0.3 install

对于节点 12+,您必须安装 bcrypt 版本 3.0.6 或更高版本。

参考:

于 2020-04-28T18:00:45.670 回答