huridocs / uwazi

Uwazi is a web-based, open-source solution for building and sharing document collections
http://www.uwazi.io
MIT License
240 stars 80 forks source link

error /home/node/uwazi/node_modules/bcrypt: Command failed #2771

Closed vasyugan closed 4 years ago

vasyugan commented 4 years ago

I am trying to build uwazi from the master branch in Docker, and it fails with

error /home/node/uwazi/node_modules/bcrypt: Command failed

Here is a complete log:

loning into '/home/node/uwazi'...
yarn install v1.19.1
[1/4] Resolving packages...
[2/4] Fetching packages...
info fsevents@1.2.9: The platform "linux" is incompatible with this module.
info "fsevents@1.2.9" is an optional dependency and failed compatibility check. Excluding it from installation.
info fsevents@1.2.4: The platform "linux" is incompatible with this module.
info "fsevents@1.2.4" is an optional dependency and failed compatibility check. Excluding it from installation.
[3/4] Linking dependencies...
warning " > react-datepicker@0.46.0" has incorrect peer dependency "react@^0.14.0 || ^15.0.0".
warning " > react-datepicker@0.46.0" has incorrect peer dependency "react-dom@^0.14.0 || ^15.0.0".
warning " > react-flags@0.1.12" has incorrect peer dependency "react@0.13 - 15.x".
warning " > react-router@3.0.5" has incorrect peer dependency "react@^0.14.0 || ^15.0.0".
warning " > react-widgets@4.0.0-rc.16" has incorrect peer dependency "react@^0.14.0 || ^15.0.0".
warning " > react-widgets@4.0.0-rc.16" has incorrect peer dependency "react-dom@^0.14.0 || ^15.0.0".
warning "@types/react-dnd > react-dnd@10.0.2" has incorrect peer dependency "react-dom@>= 16.8".
warning " > eslint-config-airbnb@17.1.0" has incorrect peer dependency "eslint-plugin-import@^2.14.0".
warning "eslint-config-airbnb > eslint-config-airbnb-base@13.1.0" has incorrect peer dependency "eslint-plugin-import@^2.14.0".
[4/4] Building fresh packages...
error /home/node/uwazi/node_modules/bcrypt: Command failed.
Exit code: 1
Command: node-pre-gyp install --fallback-to-build
Arguments: 
Directory: /home/node/uwazi/node_modules/bcrypt
Output:
node-pre-gyp info it worked if it ends with ok
node-pre-gyp info using node-pre-gyp@0.12.0
node-pre-gyp info using node@10.17.0 | linux | x64
node-pre-gyp WARN Using request for node-pre-gyp https download 
node-pre-gyp info check checked for "/home/node/uwazi/node_modules/bcrypt/lib/binding/bcrypt_lib.node" (not found)
node-pre-gyp http GET https://github.com/kelektiv/node.bcrypt.js/releases/download/v3.0.3/bcrypt_lib-v3.0.3-node-v64-linux-x64-glibc.tar.gz
node-pre-gyp http 404 https://github.com/kelektiv/node.bcrypt.js/releases/download/v3.0.3/bcrypt_lib-v3.0.3-node-v64-linux-x64-glibc.tar.gz
node-pre-gyp WARN Tried to download(404): https://github.com/kelektiv/node.bcrypt.js/releases/download/v3.0.3/bcrypt_lib-v3.0.3-node-v64-linux-x64-glibc.tar.gz 
node-pre-gyp WARN Pre-built binaries not found for bcrypt@3.0.3 and node@10.17.0 (node-v64 ABI, glibc) (falling back to source compile with node-gyp) 
node-pre-gyp http 404 status code downloading tarball https://github.com/kelektiv/node.bcrypt.js/releases/download/v3.0.3/bcrypt_lib-v3.0.3-node-v64-linux-x64-glibc.tar.gz 
gyp info it worked if it ends with ok
gyp info using node-gyp@3.6.2
gyp info using node@10.17.0 | linux | x64
gyp info ok 
gyp info it worked if it ends with ok
gyp info using node-gyp@3.6.2
gyp info using node@10.17.0 | linux | x64
gyp ERR! configure error 
gyp ERR! stack Error: Can't find Python executable "python", you can set the PYTHON env variable.
gyp ERR! stack     at PythonFinder.failNoPython (/home/node/uwazi/node_modules/node-gyp/lib/configure.js:483:19)
gyp ERR! stack     at PythonFinder.<anonymous> (/home/node/uwazi/node_modules/node-gyp/lib/configure.js:397:16)
gyp ERR! stack     at F (/home/node/uwazi/node_modules/which/which.js:68:16)
gyp ERR! stack     at E (/home/node/uwazi/node_modules/which/which.js:80:29)
gyp ERR! stack     at /home/node/uwazi/node_modules/which/which.js:89:16
gyp ERR! stack     at /home/node/uwazi/node_modules/isexe/index.js:42:5
gyp ERR! stack     at /home/node/uwazi/node_modules/isexe/mode.js:8:5
gyp ERR! stack     at FSReqWrap.oncomplete (fs.js:153:21)
gyp ERR! System Linux 4.19.0-8-amd64
gyp ERR! command "/usr/local/bin/node" "/home/node/uwazi/node_modules/node-gyp/bin/node-gyp.js" "configure" "--fallback-to-build" "--module=/home/node/uwazi/node_modules/bcrypt/lib/binding/bcrypt_lib.node" "--module_name=bcrypt_lib" "--module_path=/home/node/uwazi/node_modules/bcrypt/lib/binding" "--napi_version=5" "--node_abi_napi=napi" "--napi_build_version=0" "--node_napi_label=node-v64"
gyp ERR! cwd /home/node/uwazi/node_modules/bcrypt
gyp ERR! node -v v10.17.0
gyp ERR! node-gyp -v v3.6.2
gyp ERR! not ok 
node-pre-gyp ERR! build error 
node-pre-gyp ERR! stack Error: Failed to execute '/usr/local/bin/node /home/node/uwazi/node_modules/node-gyp/bin/node-gyp.js configure --fallback-to-build --module=/home/node/uwazi/node_modules/bcrypt/lib/binding/bcrypt_lib.node --module_name=bcrypt_lib --module_path=/home/node/uwazi/node_modules/bcrypt/lib/binding --napi_version=5 --node_abi_napi=napi --napi_build_version=0 --node_napi_label=node-v64' (1)
node-pre-gyp ERR! stack     at ChildProcess.<anonymous> (/home/node/uwazi/node_modules/node-pre-gyp/lib/util/compile.js:83:29)
node-pre-gyp ERR! stack     at ChildProcess.emit (events.js:198:13)
node-pre-gyp ERR! stack     at maybeClose (internal/child_process.js:982:16)
node-pre-gyp ERR! stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:259:5)
node-pre-gyp ERR! System Linux 4.19.0-8-amd64
node-pre-gyp ERR! command "/usr/local/bin/node" "/home/node/uwazi/node_modules/bcrypt/node_modules/.bin/node-pre-gyp" "install" "--fallback-to-build"
node-pre-gyp ERR! cwd /home/node/uwazi/node_modules/bcrypt
node-pre-gyp ERR! node -v v10.17.0
node-pre-gyp ERR! node-pre-gyp -v v0.12.0
node-pre-gyp ERR! not ok 
Failed to execute '/usr/local/bin/node /home/node/uwazi/node_modules/node-gyp/bin/node-gyp.js configure --fallback-to-build --module=/home/node/uwazi/node_modules/bcrypt/lib/binding/bcrypt_lib.node --module_name=bcrypt_lib --module_path=/home/node/uwazi/node_modules/bcrypt/lib/binding --napi_version=5 --node_abi_napi=napi --napi_build_version=0 --node_napi_label=node-v64' (1)
info Visit https://yarnpkg.com/en/docs/cli/install for documentation about this command.
ERROR: Service 'uwazi' failed to build: The command '/bin/sh -c git clone -b master --single-branch --depth=1 https://github.com/huridocs/uwazi.git /home/node/uwazi/   && chown node:node -R /home/node/uwazi/   && cd /home/node/uwazi/   && yarn install   && yarn production-build' returned a non-zero code: 1
vasyugan commented 4 years ago

Maybe related to https://github.com/kelektiv/node.bcrypt.js/issues/766 ?

vasyugan commented 4 years ago

OK, should have read the updated install instructions. Sorry! Now added

npm config set scripts-prepend-node-path auto

which seems to be getting me across this hurdle.