Не уверен, почему я получаю ошибки при попытке опубликовать sh Github Rep в Heroku - PullRequest
0 голосов
/ 28 апреля 2020

Я хотел создать и настроить внутреннюю систему проверки мобильного устройства для работы (чтобы лучше вести инвентаризацию). Я нашел этот проект на GitHub, и мне показалось, что я могу использовать его шаблон проектирования в качестве основы для моей системы.

Проблема в том, что после того, как я разложил его и попытался опубликовать sh на Heroku, я продолжал получать ошибки развертывания. Не уверен, что этот проект не работает, или я что-то мне не хватает. Я открыт для других репозиториев github, которые также используют JS и MongoDB.

Любая помощь приветствуется

Проект: 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 

посмотрите, как это

1 Ответ

0 голосов
/ 28 апреля 2020

Вы устанавливаете два несовместимых пакета.

Загрузка и установка узла 12.16.2 ...
...
> bcrypt@1.0.3 install

Для узла 12+ необходимо установить bcrypt версии 3.0.6 или выше.

Ссылка:

...