profile
viewpoint

Ask questionsUnable to install bcrypt (WSL)

I have installed build-essentials, gcc, make etc:

sudo apt-get install -y build-essential python
  • What went wrong? Installing bcrypt
  • What did you expect to happen? bcrypt to install
  • Which version of nodejs and OS?
[2019-08-21T15:10:23-0400] [linuxme] app (AAA-111) $ node-gyp -v
v5.0.3
[2019-08-21T15:10:23-0400] [linuxme] app (AAA-111) $ python --version
Python 2.7.15+
[2019-08-21T15:10:23-0400] [linuxme] app (AAA-111) $ uname -r
4.4.0-18362-Microsoft
[2019-08-21T15:10:23-0400] [linuxme] app (AAA-111) $ npm -v
6.11.2
[2019-08-21T15:10:23-0400] [linuxme] app (AAA-111) $ node -v
v12.8.1
[2019-08-21T15:10:23-0400] [linuxme] app (AAA-111) $ gcc -v
Using built-in specs.
COLLECT_GCC=gcc
COLLECT_LTO_WRAPPER=/usr/lib/gcc/x86_64-linux-gnu/7/lto-wrapper
OFFLOAD_TARGET_NAMES=nvptx-none
OFFLOAD_TARGET_DEFAULT=1
Target: x86_64-linux-gnu
Configured with: ../src/configure -v --with-pkgversion='Ubuntu 7.4.0-1ubuntu1~18.04.1' --with-bugurl=file:///usr/share/doc/gcc-7/README.Bugs --enable-languages=c,ada,c++,go,brig,d,fortran,objc,obj-c++ --prefix=/usr --with-gcc-major-version-only --program-suffix=-7 --program-prefix=x86_64-linux-gnu- --enable-shared --enable-linker-build-id --libexecdir=/usr/lib --without-included-gettext --enable-threads=posix --libdir=/usr/lib --enable-nls --with-sysroot=/ --enable-clocale=gnu --enable-libstdcxx-debug --enable-libstdcxx-time=yes --with-default-libstdcxx-abi=new --enable-gnu-unique-object --disable-vtable-verify --enable-libmpx --enable-plugin --enable-default-pie --with-system-zlib --with-target-system-zlib --enable-objc-gc=auto --enable-multiarch --disable-werror --with-arch-32=i686 --with-abi=m64 --with-multilib-list=m32,m64,mx32 --enable-multilib --with-tune=generic --enable-offload-targets=nvptx-none --without-cuda-driver --enable-checking=release --build=x86_64-linux-gnu --host=x86_64-linux-gnu --target=x86_64-linux-gnu
Thread model: posix
gcc version 7.4.0 (Ubuntu 7.4.0-1ubuntu1~18.04.1)

Full Log: (Also happens if I do npm install --build-from-source=bcrypt)

[2019-08-21T15:10:23-0400] [linuxme] app (AAA-111) $ npm install

> mcrypt@0.1.15 install /c/Users/me/Documents/repos/pathTo/projectPath/app/node_modules/mcrypt
> node-gyp rebuild

make: Entering directory '/c/Users/me/Documents/repos/pathTo/projectPath/app/node_modules/mcrypt/build'
  CC(target) Release/obj.target/libmcrypt/lib/libmcrypt/modules/algorithms/3-way.o
In file included from /usr/include/string.h:494:0,
                 from ../lib/libmcrypt/lib/libdefs.h:24,
                 from ../lib/libmcrypt/modules/algorithms/3-way.c:14:
In function ‘memcpy’,
    inlined from ‘threeway_LTX__mcrypt_self_test’ at ../lib/libmcrypt/modules/algorithms/3-way.c:309:2:
/usr/include/x86_64-linux-gnu/bits/string_fortified.h:34:10: warning: ‘__builtin___memcpy_chk’: specified size between 18446744071562067968 and 18446744073709551615 exceeds maximum object size 9223372036854775807 [-Wstringop-overflow=]
   return __builtin___memcpy_chk (__dest, __src, __len, __bos0 (__dest));
          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  CC(target) Release/obj.target/libmcrypt/lib/libmcrypt/modules/algorithms/arcfour.o
  CC(target) Release/obj.target/libmcrypt/lib/libmcrypt/modules/algorithms/blowfish.o
In file included from /usr/include/string.h:494:0,
                 from ../lib/libmcrypt/lib/libdefs.h:24,
                 from ../lib/libmcrypt/modules/algorithms/blowfish.c:12:
In function ‘memcpy’,
    inlined from ‘blowfish_LTX__mcrypt_self_test’ at ../lib/libmcrypt/modules/algorithms/blowfish.c:533:2:
/usr/include/x86_64-linux-gnu/bits/string_fortified.h:34:10: warning: ‘__builtin___memcpy_chk’: specified size between 18446744071562067968 and 18446744073709551615 exceeds maximum object size 9223372036854775807 [-Wstringop-overflow=]
   return __builtin___memcpy_chk (__dest, __src, __len, __bos0 (__dest));
          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  CC(target) Release/obj.target/libmcrypt/lib/libmcrypt/modules/algorithms/blowfish-compat.o
In file included from /usr/include/string.h:494:0,
                 from ../lib/libmcrypt/lib/libdefs.h:24,
                 from ../lib/libmcrypt/modules/algorithms/blowfish-compat.c:12:
In function ‘memcpy’,
    inlined from ‘blowfish_compat_LTX__mcrypt_self_test’ at ../lib/libmcrypt/modules/algorithms/blowfish-compat.c:625:2:
/usr/include/x86_64-linux-gnu/bits/string_fortified.h:34:10: warning: ‘__builtin___memcpy_chk’: specified size between 18446744071562067968 and 18446744073709551615 exceeds maximum object size 9223372036854775807 [-Wstringop-overflow=]
   return __builtin___memcpy_chk (__dest, __src, __len, __bos0 (__dest));
          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  CC(target) Release/obj.target/libmcrypt/lib/libmcrypt/modules/algorithms/cast-128.o
In file included from /usr/include/string.h:494:0,
                 from ../lib/libmcrypt/lib/libdefs.h:24,
                 from ../lib/libmcrypt/modules/algorithms/cast-128.c:18:
In function ‘memcpy’,
    inlined from ‘cast_128_LTX__mcrypt_self_test’ at ../lib/libmcrypt/modules/algorithms/cast-128.c:361:2:
/usr/include/x86_64-linux-gnu/bits/string_fortified.h:34:10: warning: ‘__builtin___memcpy_chk’: specified size between 18446744071562067968 and 18446744073709551615 exceeds maximum object size 9223372036854775807 [-Wstringop-overflow=]
   return __builtin___memcpy_chk (__dest, __src, __len, __bos0 (__dest));
          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  CC(target) Release/obj.target/libmcrypt/lib/libmcrypt/modules/algorithms/cast-256.o
In file included from /usr/include/string.h:494:0,
                 from ../lib/libmcrypt/lib/libdefs.h:24,
                 from ../lib/libmcrypt/modules/algorithms/cast-256.c:67:
In function ‘memcpy’,
    inlined from ‘cast_256_LTX__mcrypt_self_test’ at ../lib/libmcrypt/modules/algorithms/cast-256.c:538:2:
/usr/include/x86_64-linux-gnu/bits/string_fortified.h:34:10: warning: ‘__builtin___memcpy_chk’: specified size between 18446744071562067968 and 18446744073709551615 exceeds maximum object size 9223372036854775807 [-Wstringop-overflow=]
   return __builtin___memcpy_chk (__dest, __src, __len, __bos0 (__dest));
          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  CC(target) Release/obj.target/libmcrypt/lib/libmcrypt/modules/algorithms/des.o
In file included from /usr/include/string.h:494:0,
                 from ../lib/libmcrypt/lib/libdefs.h:24,
                 from ../lib/libmcrypt/modules/algorithms/des.c:19:
In function ‘memcpy’,
    inlined from ‘des_LTX__mcrypt_self_test’ at ../lib/libmcrypt/modules/algorithms/des.c:631:2:
/usr/include/x86_64-linux-gnu/bits/string_fortified.h:34:10: warning: ‘__builtin___memcpy_chk’: specified size between 18446744071562067968 and 18446744073709551615 exceeds maximum object size 9223372036854775807 [-Wstringop-overflow=]
   return __builtin___memcpy_chk (__dest, __src, __len, __bos0 (__dest));
          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  CC(target) Release/obj.target/libmcrypt/lib/libmcrypt/modules/algorithms/enigma.o
  CC(target) Release/obj.target/libmcrypt/lib/libmcrypt/modules/algorithms/gost.o
In file included from /usr/include/string.h:494:0,
                 from ../lib/libmcrypt/lib/libdefs.h:24,
                 from ../lib/libmcrypt/modules/algorithms/gost.c:40:
In function ‘memcpy’,
    inlined from ‘gost_LTX__mcrypt_self_test’ at ../lib/libmcrypt/modules/algorithms/gost.c:381:2:
/usr/include/x86_64-linux-gnu/bits/string_fortified.h:34:10: warning: ‘__builtin___memcpy_chk’: specified size between 18446744071562067968 and 18446744073709551615 exceeds maximum object size 9223372036854775807 [-Wstringop-overflow=]
   return __builtin___memcpy_chk (__dest, __src, __len, __bos0 (__dest));
          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  CC(target) Release/obj.target/libmcrypt/lib/libmcrypt/modules/algorithms/loki97.o
In file included from /usr/include/string.h:494:0,
                 from ../lib/libmcrypt/lib/libdefs.h:24,
                 from ../lib/libmcrypt/modules/algorithms/loki97.c:66:
In function ‘memcpy’,
    inlined from ‘loki97_LTX__mcrypt_self_test’ at ../lib/libmcrypt/modules/algorithms/loki97.c:442:2:
/usr/include/x86_64-linux-gnu/bits/string_fortified.h:34:10: warning: ‘__builtin___memcpy_chk’: specified size between 18446744071562067968 and 18446744073709551615 exceeds maximum object size 9223372036854775807 [-Wstringop-overflow=]
   return __builtin___memcpy_chk (__dest, __src, __len, __bos0 (__dest));
          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  CC(target) Release/obj.target/libmcrypt/lib/libmcrypt/modules/algorithms/panama.o
  CC(target) Release/obj.target/libmcrypt/lib/libmcrypt/modules/algorithms/rc2.o
In file included from /usr/include/string.h:494:0,
                 from ../lib/libmcrypt/lib/libdefs.h:24,
                 from ../lib/libmcrypt/modules/algorithms/rc2.c:18:
In function ‘memcpy’,
    inlined from ‘rc2_LTX__mcrypt_self_test’ at ../lib/libmcrypt/modules/algorithms/rc2.c:281:2:
/usr/include/x86_64-linux-gnu/bits/string_fortified.h:34:10: warning: ‘__builtin___memcpy_chk’: specified size between 18446744071562067968 and 18446744073709551615 exceeds maximum object size 9223372036854775807 [-Wstringop-overflow=]
   return __builtin___memcpy_chk (__dest, __src, __len, __bos0 (__dest));
          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  CC(target) Release/obj.target/libmcrypt/lib/libmcrypt/modules/algorithms/rijndael-128.o
In file included from /usr/include/string.h:494:0,
                 from ../lib/libmcrypt/lib/libdefs.h:24,
                 from ../lib/libmcrypt/modules/algorithms/rijndael-128.c:24:
In function ‘memcpy’,
    inlined from ‘rijndael_128_LTX__mcrypt_self_test’ at ../lib/libmcrypt/modules/algorithms/rijndael-128.c:465:2:
/usr/include/x86_64-linux-gnu/bits/string_fortified.h:34:10: warning: ‘__builtin___memcpy_chk’: specified size between 18446744071562067968 and 18446744073709551615 exceeds maximum object size 9223372036854775807 [-Wstringop-overflow=]
   return __builtin___memcpy_chk (__dest, __src, __len, __bos0 (__dest));
          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  CC(target) Release/obj.target/libmcrypt/lib/libmcrypt/modules/algorithms/rijndael-192.o
In file included from /usr/include/string.h:494:0,
                 from ../lib/libmcrypt/lib/libdefs.h:24,
                 from ../lib/libmcrypt/modules/algorithms/rijndael-192.c:25:
In function ‘memcpy’,
    inlined from ‘rijndael_192_LTX__mcrypt_self_test’ at ../lib/libmcrypt/modules/algorithms/rijndael-192.c:463:2:
/usr/include/x86_64-linux-gnu/bits/string_fortified.h:34:10: warning: ‘__builtin___memcpy_chk’: specified size between 18446744071562067968 and 18446744073709551615 exceeds maximum object size 9223372036854775807 [-Wstringop-overflow=]
   return __builtin___memcpy_chk (__dest, __src, __len, __bos0 (__dest));
          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  CC(target) Release/obj.target/libmcrypt/lib/libmcrypt/modules/algorithms/rijndael-256.o
In file included from /usr/include/string.h:494:0,
                 from ../lib/libmcrypt/lib/libdefs.h:24,
                 from ../lib/libmcrypt/modules/algorithms/rijndael-256.c:24:
In function ‘memcpy’,
    inlined from ‘rijndael_256_LTX__mcrypt_self_test’ at ../lib/libmcrypt/modules/algorithms/rijndael-256.c:464:2:
/usr/include/x86_64-linux-gnu/bits/string_fortified.h:34:10: warning: ‘__builtin___memcpy_chk’: specified size between 18446744071562067968 and 18446744073709551615 exceeds maximum object size 9223372036854775807 [-Wstringop-overflow=]
   return __builtin___memcpy_chk (__dest, __src, __len, __bos0 (__dest));
          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  CC(target) Release/obj.target/libmcrypt/lib/libmcrypt/modules/algorithms/safer64.o
In file included from /usr/include/string.h:494:0,
                 from ../lib/libmcrypt/lib/libdefs.h:24,
                 from ../lib/libmcrypt/modules/algorithms/safer64.c:29:
In function ‘memcpy’,
    inlined from ‘safer_sk64_LTX__mcrypt_self_test’ at ../lib/libmcrypt/modules/algorithms/safer64.c:353:2:
/usr/include/x86_64-linux-gnu/bits/string_fortified.h:34:10: warning: ‘__builtin___memcpy_chk’: specified size between 18446744071562067968 and 18446744073709551615 exceeds maximum object size 9223372036854775807 [-Wstringop-overflow=]
   return __builtin___memcpy_chk (__dest, __src, __len, __bos0 (__dest));
          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  CC(target) Release/obj.target/libmcrypt/lib/libmcrypt/modules/algorithms/safer128.o
In file included from /usr/include/string.h:494:0,
                 from ../lib/libmcrypt/lib/libdefs.h:24,
                 from ../lib/libmcrypt/modules/algorithms/safer128.c:30:
In function ‘memcpy’,
    inlined from ‘safer_sk128_LTX__mcrypt_self_test’ at ../lib/libmcrypt/modules/algorithms/safer128.c:355:2:
/usr/include/x86_64-linux-gnu/bits/string_fortified.h:34:10: warning: ‘__builtin___memcpy_chk’: specified size between 18446744071562067968 and 18446744073709551615 exceeds maximum object size 9223372036854775807 [-Wstringop-overflow=]
   return __builtin___memcpy_chk (__dest, __src, __len, __bos0 (__dest));
          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  CC(target) Release/obj.target/libmcrypt/lib/libmcrypt/modules/algorithms/saferplus.o
In file included from /usr/include/string.h:494:0,
                 from ../lib/libmcrypt/lib/libdefs.h:24,
                 from ../lib/libmcrypt/modules/algorithms/saferplus.c:66:
In function ‘memcpy’,
    inlined from ‘saferplus_LTX__mcrypt_self_test’ at ../lib/libmcrypt/modules/algorithms/saferplus.c:645:2:
/usr/include/x86_64-linux-gnu/bits/string_fortified.h:34:10: warning: ‘__builtin___memcpy_chk’: specified size between 18446744071562067968 and 18446744073709551615 exceeds maximum object size 9223372036854775807 [-Wstringop-overflow=]
   return __builtin___memcpy_chk (__dest, __src, __len, __bos0 (__dest));
          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  CC(target) Release/obj.target/libmcrypt/lib/libmcrypt/modules/algorithms/serpent.o
In file included from /usr/include/string.h:494:0,
                 from ../lib/libmcrypt/lib/libdefs.h:24,
                 from ../lib/libmcrypt/modules/algorithms/serpent.c:42:
In function ‘memcpy’,
    inlined from ‘serpent_LTX__mcrypt_self_test’ at ../lib/libmcrypt/modules/algorithms/serpent.c:925:2:
/usr/include/x86_64-linux-gnu/bits/string_fortified.h:34:10: warning: ‘__builtin___memcpy_chk’: specified size between 18446744071562067968 and 18446744073709551615 exceeds maximum object size 9223372036854775807 [-Wstringop-overflow=]
   return __builtin___memcpy_chk (__dest, __src, __len, __bos0 (__dest));
          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  CC(target) Release/obj.target/libmcrypt/lib/libmcrypt/modules/algorithms/tripledes.o
  CC(target) Release/obj.target/libmcrypt/lib/libmcrypt/modules/algorithms/twofish.o
../lib/libmcrypt/modules/algorithms/twofish.c: In function ‘h_fun’:
../lib/libmcrypt/modules/algorithms/twofish.c:229:6: warning: this statement may fall through [-Wimplicit-fallthrough=]
   b3 = q(1, b3) ^ byte(key[3], 3);
      ^
../lib/libmcrypt/modules/algorithms/twofish.c:230:2: note: here
  case 3:
  ^~~~
../lib/libmcrypt/modules/algorithms/twofish.c:234:6: warning: this statement may fall through [-Wimplicit-fallthrough=]
   b3 = q(0, b3) ^ byte(key[2], 3);
      ^
../lib/libmcrypt/modules/algorithms/twofish.c:235:2: note: here
  case 2:
  ^~~~
  CC(target) Release/obj.target/libmcrypt/lib/libmcrypt/modules/algorithms/wake.o
  CC(target) Release/obj.target/libmcrypt/lib/libmcrypt/modules/algorithms/xtea.o
In file included from /usr/include/string.h:494:0,
                 from ../lib/libmcrypt/lib/libdefs.h:24,
                 from ../lib/libmcrypt/modules/algorithms/xtea.c:13:
In function ‘memcpy’,
    inlined from ‘xtea_LTX__mcrypt_self_test’ at ../lib/libmcrypt/modules/algorithms/xtea.c:198:2:
/usr/include/x86_64-linux-gnu/bits/string_fortified.h:34:10: warning: ‘__builtin___memcpy_chk’: specified size between 18446744071562067968 and 18446744073709551615 exceeds maximum object size 9223372036854775807 [-Wstringop-overflow=]
   return __builtin___memcpy_chk (__dest, __src, __len, __bos0 (__dest));
          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  CC(target) Release/obj.target/libmcrypt/lib/libmcrypt/modules/modes/cbc.o
  CC(target) Release/obj.target/libmcrypt/lib/libmcrypt/modules/modes/cfb.o
  CC(target) Release/obj.target/libmcrypt/lib/libmcrypt/modules/modes/ctr.o
  CC(target) Release/obj.target/libmcrypt/lib/libmcrypt/modules/modes/ecb.o
  CC(target) Release/obj.target/libmcrypt/lib/libmcrypt/modules/modes/ncfb.o
  CC(target) Release/obj.target/libmcrypt/lib/libmcrypt/modules/modes/nofb.o
  CC(target) Release/obj.target/libmcrypt/lib/libmcrypt/modules/modes/ofb.o
  CC(target) Release/obj.target/libmcrypt/lib/libmcrypt/modules/modes/stream.o
  CC(target) Release/obj.target/libmcrypt/lib/libmcrypt/lib/bzero.o
  CC(target) Release/obj.target/libmcrypt/lib/libmcrypt/lib/mcrypt.o
  CC(target) Release/obj.target/libmcrypt/lib/libmcrypt/lib/mcrypt_extra.o
  CC(target) Release/obj.target/libmcrypt/lib/libmcrypt/lib/mcrypt_modules.o
  CC(target) Release/obj.target/libmcrypt/lib/libmcrypt/lib/mcrypt_symb.o
  CC(target) Release/obj.target/libmcrypt/lib/libmcrypt/lib/xmemory.o
  AR(target) Release/obj.target/lib/libmcrypt/mcrypt.a
  COPY Release/mcrypt.a
  CXX(target) Release/obj.target/mcrypt/src/mcrypt.o
In file included from ../src/mcrypt.cc:3:0:
../src/mcrypt.h:21:26: error: ‘Handle’ has not been declared
         static void Init(Handle<Object> exports);
                          ^~~~~~
../src/mcrypt.h:21:32: error: expected ‘,’ or ‘...’ before ‘<’ token
         static void Init(Handle<Object> exports);
                                ^
../src/mcrypt.cc: In static member function ‘static Nan::NAN_METHOD_RETURN_TYPE MCrypt::ValidateKeySize(Nan::NAN_METHOD_ARGS_TYPE)’:
../src/mcrypt.cc:294:47: error: no matching function for call to ‘v8::Value::ToBoolean()’
     Local<Boolean> state = info[0]->ToBoolean();
                                               ^
In file included from /home/linuxme/.cache/node-gyp/12.8.1/include/node/v8-internal.h:14:0,
                 from /home/linuxme/.cache/node-gyp/12.8.1/include/node/v8.h:25,
                 from /home/linuxme/.cache/node-gyp/12.8.1/include/node/node.h:63,
                 from ../../nan/nan.h:54,
                 from ../src/mcrypt.h:9,
                 from ../src/mcrypt.cc:3:
/home/linuxme/.cache/node-gyp/12.8.1/include/node/v8.h:2531:59: note: candidate: v8::MaybeLocal<v8::Boolean> v8::Value::ToBoolean(v8::Local<v8::Context>) const
                 V8_WARN_UNUSED_RESULT MaybeLocal<Boolean> ToBoolean(
                                                           ^
/home/linuxme/.cache/node-gyp/12.8.1/include/node/v8config.h:311:3: note: in definition of macro ‘V8_DEPRECATED’
   declarator __attribute__((deprecated(message)))
   ^~~~~~~~~~
/home/linuxme/.cache/node-gyp/12.8.1/include/node/v8.h:2531:59: note:   candidate expects 1 argument, 0 provided
                 V8_WARN_UNUSED_RESULT MaybeLocal<Boolean> ToBoolean(
                                                           ^
/home/linuxme/.cache/node-gyp/12.8.1/include/node/v8config.h:311:3: note: in definition of macro ‘V8_DEPRECATED’
   declarator __attribute__((deprecated(message)))
   ^~~~~~~~~~
In file included from /home/linuxme/.cache/node-gyp/12.8.1/include/node/node.h:63:0,
                 from ../../nan/nan.h:54,
                 from ../src/mcrypt.h:9,
                 from ../src/mcrypt.cc:3:
/home/linuxme/.cache/node-gyp/12.8.1/include/node/v8.h:2547:18: note: candidate: v8::Local<v8::Boolean> v8::Value::ToBoolean(v8::Isolate*) const
   Local<Boolean> ToBoolean(Isolate* isolate) const;
                  ^~~~~~~~~
/home/linuxme/.cache/node-gyp/12.8.1/include/node/v8.h:2547:18: note:   candidate expects 1 argument, 0 provided
../src/mcrypt.cc: In static member function ‘static Nan::NAN_METHOD_RETURN_TYPE MCrypt::ValidateIvSize(Nan::NAN_METHOD_ARGS_TYPE)’:
../src/mcrypt.cc:307:47: error: no matching function for call to ‘v8::Value::ToBoolean()’
     Local<Boolean> state = info[0]->ToBoolean();
                                               ^
In file included from /home/linuxme/.cache/node-gyp/12.8.1/include/node/v8-internal.h:14:0,
                 from /home/linuxme/.cache/node-gyp/12.8.1/include/node/v8.h:25,
                 from /home/linuxme/.cache/node-gyp/12.8.1/include/node/node.h:63,
                 from ../../nan/nan.h:54,
                 from ../src/mcrypt.h:9,
                 from ../src/mcrypt.cc:3:
/home/linuxme/.cache/node-gyp/12.8.1/include/node/v8.h:2531:59: note: candidate: v8::MaybeLocal<v8::Boolean> v8::Value::ToBoolean(v8::Local<v8::Context>) const
                 V8_WARN_UNUSED_RESULT MaybeLocal<Boolean> ToBoolean(
                                                           ^
/home/linuxme/.cache/node-gyp/12.8.1/include/node/v8config.h:311:3: note: in definition of macro ‘V8_DEPRECATED’
   declarator __attribute__((deprecated(message)))
   ^~~~~~~~~~
/home/linuxme/.cache/node-gyp/12.8.1/include/node/v8.h:2531:59: note:   candidate expects 1 argument, 0 provided
                 V8_WARN_UNUSED_RESULT MaybeLocal<Boolean> ToBoolean(
                                                           ^
/home/linuxme/.cache/node-gyp/12.8.1/include/node/v8config.h:311:3: note: in definition of macro ‘V8_DEPRECATED’
   declarator __attribute__((deprecated(message)))
   ^~~~~~~~~~
In file included from /home/linuxme/.cache/node-gyp/12.8.1/include/node/node.h:63:0,
                 from ../../nan/nan.h:54,
                 from ../src/mcrypt.h:9,
                 from ../src/mcrypt.cc:3:
/home/linuxme/.cache/node-gyp/12.8.1/include/node/v8.h:2547:18: note: candidate: v8::Local<v8::Boolean> v8::Value::ToBoolean(v8::Isolate*) const
   Local<Boolean> ToBoolean(Isolate* isolate) const;
                  ^~~~~~~~~
/home/linuxme/.cache/node-gyp/12.8.1/include/node/v8.h:2547:18: note:   candidate expects 1 argument, 0 provided
../src/mcrypt.cc: In static member function ‘static Nan::NAN_METHOD_RETURN_TYPE MCrypt::GetSupportedKeySizes(Nan::NAN_METHOD_ARGS_TYPE)’:
../src/mcrypt.cc:398:52: warning: ‘bool v8::Object::Set(uint32_t, v8::Local<v8::Value>)’ is deprecated: Use maybe version [-Wdeprecated-declarations]
         array->Set(i, Nan::New<Number>(keySizes[i]));
                                                    ^
In file included from /home/linuxme/.cache/node-gyp/12.8.1/include/node/v8-internal.h:14:0,
                 from /home/linuxme/.cache/node-gyp/12.8.1/include/node/v8.h:25,
                 from /home/linuxme/.cache/node-gyp/12.8.1/include/node/node.h:63,
                 from ../../nan/nan.h:54,
                 from ../src/mcrypt.h:9,
                 from ../src/mcrypt.cc:3:
/home/linuxme/.cache/node-gyp/12.8.1/include/node/v8.h:3375:26: note: declared here
                     bool Set(uint32_t index, Local<Value> value));
                          ^
/home/linuxme/.cache/node-gyp/12.8.1/include/node/v8config.h:326:3: note: in definition of macro ‘V8_DEPRECATE_SOON’
   declarator __attribute__((deprecated(message)))
   ^~~~~~~~~~
../src/mcrypt.cc: In static member function ‘static Nan::NAN_METHOD_RETURN_TYPE MCrypt::GetAlgorithmNames(Nan::NAN_METHOD_ARGS_TYPE)’:
../src/mcrypt.cc:476:66: warning: ‘bool v8::Object::Set(uint32_t, v8::Local<v8::Value>)’ is deprecated: Use maybe version [-Wdeprecated-declarations]
         array->Set(i, Nan::New<String>(algos[i]).ToLocalChecked());
                                                                  ^
In file included from /home/linuxme/.cache/node-gyp/12.8.1/include/node/v8-internal.h:14:0,
                 from /home/linuxme/.cache/node-gyp/12.8.1/include/node/v8.h:25,
                 from /home/linuxme/.cache/node-gyp/12.8.1/include/node/node.h:63,
                 from ../../nan/nan.h:54,
                 from ../src/mcrypt.h:9,
                 from ../src/mcrypt.cc:3:
/home/linuxme/.cache/node-gyp/12.8.1/include/node/v8.h:3375:26: note: declared here
                     bool Set(uint32_t index, Local<Value> value));
                          ^
/home/linuxme/.cache/node-gyp/12.8.1/include/node/v8config.h:326:3: note: in definition of macro ‘V8_DEPRECATE_SOON’
   declarator __attribute__((deprecated(message)))
   ^~~~~~~~~~
../src/mcrypt.cc: In static member function ‘static Nan::NAN_METHOD_RETURN_TYPE MCrypt::GetModeNames(Nan::NAN_METHOD_ARGS_TYPE)’:
../src/mcrypt.cc:495:66: warning: ‘bool v8::Object::Set(uint32_t, v8::Local<v8::Value>)’ is deprecated: Use maybe version [-Wdeprecated-declarations]
         array->Set(i, Nan::New<String>(modes[i]).ToLocalChecked());
                                                                  ^
In file included from /home/linuxme/.cache/node-gyp/12.8.1/include/node/v8-internal.h:14:0,
                 from /home/linuxme/.cache/node-gyp/12.8.1/include/node/v8.h:25,
                 from /home/linuxme/.cache/node-gyp/12.8.1/include/node/node.h:63,
                 from ../../nan/nan.h:54,
                 from ../src/mcrypt.h:9,
                 from ../src/mcrypt.cc:3:
/home/linuxme/.cache/node-gyp/12.8.1/include/node/v8.h:3375:26: note: declared here
                     bool Set(uint32_t index, Local<Value> value));
                          ^
/home/linuxme/.cache/node-gyp/12.8.1/include/node/v8config.h:326:3: note: in definition of macro ‘V8_DEPRECATE_SOON’
   declarator __attribute__((deprecated(message)))
   ^~~~~~~~~~
../src/mcrypt.cc: At global scope:
../src/mcrypt.cc:503:19: error: variable or field ‘Init’ declared void
 void MCrypt::Init(Handle<Object> exports) {
                   ^~~~~~
../src/mcrypt.cc:503:19: error: ‘Handle’ was not declared in this scope
../src/mcrypt.cc:503:19: note: suggested alternative: ‘rand_r’
 void MCrypt::Init(Handle<Object> exports) {
                   ^~~~~~
                   rand_r
../src/mcrypt.cc:503:32: error: expected primary-expression before ‘>’ token
 void MCrypt::Init(Handle<Object> exports) {
                                ^
../src/mcrypt.cc:503:34: error: ‘exports’ was not declared in this scope
 void MCrypt::Init(Handle<Object> exports) {
                                  ^~~~~~~
mcrypt.target.mk:114: recipe for target 'Release/obj.target/mcrypt/src/mcrypt.o' failed
make: *** [Release/obj.target/mcrypt/src/mcrypt.o] Error 1
make: Leaving directory '/c/Users/me/Documents/repos/pathTo/projectPath/app/node_modules/mcrypt/build'
gyp ERR! build error
gyp ERR! stack Error: `make` failed with exit code: 2
gyp ERR! stack     at ChildProcess.onExit (/home/linuxme/.nvm/versions/node/v12.8.1/lib/node_modules/npm/node_modules/node-gyp/lib/build.js:196:23)
gyp ERR! stack     at ChildProcess.emit (events.js:203:13)
gyp ERR! stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:272:12)
gyp ERR! System Linux 4.4.0-18362-Microsoft
gyp ERR! command "/home/linuxme/.nvm/versions/node/v12.8.1/bin/node" "/home/linuxme/.nvm/versions/node/v12.8.1/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild"
gyp ERR! cwd /c/Users/me/Documents/repos/pathTo/projectPath/app/node_modules/mcrypt
gyp ERR! node -v v12.8.1
gyp ERR! node-gyp -v v5.0.3
gyp ERR! not ok
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@1.2.9 (node_modules/fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@1.2.9: wanted {"os":"darwin","arch":"any"} (current: {"os":"linux","arch":"x64"})

npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! mcrypt@0.1.15 install: `node-gyp rebuild`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the mcrypt@0.1.15 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!     /home/linuxme/.npm/_logs/2019-08-26T20_24_58_935Z-debug.log
kelektiv/node.bcrypt.js

Answer questions YasharF

OSX issue is probably something different. I would keep that as a separate issue. I can't reproduce the issue on a clean WSL and it is pointing to something in your setup. I do not have/need to have node-gyp installed as a global package. node-pre-gyp is already in package.json and takes care of node-gyp dependency.

Test env setup:

  • Clean deployment of Windows+WSL (Not WSL 2 - WSL 2 is still in beta and I consider that unsupported and problematic with many things)
  • Setup in WSL after a fresh Windows+WSL Ubuntu install:
sudo apt-get update
sudo apt-get upgrade -y
curl -sL https://deb.nodesource.com/setup_12.x | sudo -E bash -
sudo apt-get install -y nodejs
sudo apt-get install -y build-essential
sudo apt-get autoremove
sudo apt-get install wslu ubuntu-wsl 
sudo apt-get update
sudo apt-get upgrade -y

Testing npm install bcrypt :

:$ npm cache clean --force
:$ cd /mnt/c/temp
:/mnt/c/temp$ mkdir test1
:/mnt/c/temp$ cd test1
:/mnt/c/temp/test1$ npm install bcrypt -s
make: Entering directory '/mnt/c/temp/test1/node_modules/bcrypt/build'
  CXX(target) Release/obj.target/bcrypt_lib/src/blowfish.o
  CXX(target) Release/obj.target/bcrypt_lib/src/bcrypt.o
  CXX(target) Release/obj.target/bcrypt_lib/src/bcrypt_node.o
  SOLINK_MODULE(target) Release/obj.target/bcrypt_lib.node
  COPY Release/bcrypt_lib.node
  COPY /mnt/c/temp/test1/node_modules/bcrypt/lib/binding/bcrypt_lib.node
  TOUCH Release/obj.target/action_after_build.stamp
make: Leaving directory '/mnt/c/temp/test1/node_modules/bcrypt/build'
+ bcrypt@3.0.6
added 68 packages from 49 contributors and audited 97 packages in 21.133s
found 0 vulnerabilities

:/mnt/c/temp/test1$ node-gyp -v

Command 'node-gyp' not found, but can be installed with:

sudo apt install node-gyp

:/mnt/c/temp/test1$  python --version
Python 2.7.15+
:/mnt/c/temp/test1$ uname -r
4.4.0-18362-Microsoft
:/mnt/c/temp/test1$ npm -v
6.10.3
:/mnt/c/temp/test1$ node -v
v12.10.0
:/mnt/c/temp/test1$ gcc -v
Using built-in specs.
COLLECT_GCC=gcc
COLLECT_LTO_WRAPPER=/usr/lib/gcc/x86_64-linux-gnu/7/lto-wrapper
OFFLOAD_TARGET_NAMES=nvptx-none
OFFLOAD_TARGET_DEFAULT=1
Target: x86_64-linux-gnu
Configured with: ../src/configure -v --with-pkgversion='Ubuntu 7.4.0-1ubuntu1~18.04.1' --with-bugurl=file:///usr/share/doc/gcc-7/README.Bugs --enable-languages=c,ada,c++,go,brig,d,fortran,objc,obj-c++ --prefix=/usr --with-gcc-major-version-only --program-suffix=-7 --program-prefix=x86_64-linux-gnu- --enable-shared --enable-linker-build-id --libexecdir=/usr/lib --without-included-gettext --enable-threads=posix --libdir=/usr/lib --enable-nls --with-sysroot=/ --enable-clocale=gnu --enable-libstdcxx-debug --enable-libstdcxx-time=yes --with-default-libstdcxx-abi=new --enable-gnu-unique-object --disable-vtable-verify --enable-libmpx --enable-plugin --enable-default-pie --with-system-zlib --with-target-system-zlib --enable-objc-gc=auto --enable-multiarch --disable-werror --with-arch-32=i686 --with-abi=m64 --with-multilib-list=m32,m64,mx32 --enable-multilib --with-tune=generic --enable-offload-targets=nvptx-none --without-cuda-driver --enable-checking=release --build=x86_64-linux-gnu --host=x86_64-linux-gnu --target=x86_64-linux-gnu
Thread model: posix
gcc version 7.4.0 (Ubuntu 7.4.0-1ubuntu1~18.04.1)

useful!
source:https://uonfu.com/
Github User Rank List