ewfian / faiss-node

Node.js bindings for faiss
https://www.npmjs.com/package/faiss-node
MIT License
107 stars 10 forks source link

Install failed #31

Open adoin opened 1 year ago

adoin commented 1 year ago
.pnpm/faiss-node@0.2.2/node_modules/faiss-node: Running install script, failed in 7s
.../node_modules/faiss-node install$ prebuild-install --runtime napi --verbose || (npm i cmake-js && npm run build)
│ prebuild-install info begin Prebuild-install version 7.1.1
│ prebuild-install info looking for local prebuild @ prebuilds\faiss-node-v0.2.2-napi-v8-win32-x64.tar.gz
│ prebuild-install info looking for cached prebuild @ C:\Users\Administrator\AppData\Roaming\npm-cache\_prebuilds\177…
│ prebuild-install http request GET https://github.com/ewfian/faiss-node/releases/download/v0.2.2/faiss-node-v0.2.2-n…
│ prebuild-install warn install unable to verify the first certificate
│ changed 70 packages in 1s
│ > faiss-node@0.2.2 build
│ > cmake-js compile
│ info find VS using VS2022 (17.6.33815.320) found at:
│ info find VS "C:\Program Files (x86)\Microsoft Visual Studio\2022\BuildTools"
│ info find VS run with --verbose for detailed information
│ info TOOL Using Visual Studio 17 2022 generator.
│ info CMD BUILD
│ info RUN [
│ info RUN   'cmake',
│ info RUN   '--build',
│ info RUN   'D:\\pnpm_repo\\global\\5\\.pnpm\\faiss-node@0.2.2\\node_modules\\faiss-node\\build',
│ info RUN   '--config',
│ info RUN   'Release'
│ info RUN ]
│ MSBuild version 17.6.3+07e294721 for .NET Framework
│ MSBUILD : error MSB1009: ��Ŀ�ļ������ڡ�
│ ����:ALL_BUILD.vcxproj
│ info REP Build has been failed, trying to do a full rebuild.
│ info CMD CLEAN
│ info RUN [
│ info RUN   'cmake',
│ info RUN   '-E',
│ info RUN   'remove_directory',
│ info RUN   'D:\\pnpm_repo\\global\\5\\.pnpm\\faiss-node@0.2.2\\node_modules\\faiss-node\\build'
│ info RUN ]
│ info CMD CONFIGURE
│ info find VS using VS2022 (17.6.33815.320) found at:
│ info find VS "C:\Program Files (x86)\Microsoft Visual Studio\2022\BuildTools"
│ info find VS run with --verbose for detailed information
│ info RUN [
│ info RUN   'cmake',
│ info RUN   'D:\\pnpm_repo\\global\\5\\.pnpm\\faiss-node@0.2.2\\node_modules\\faiss-node',
│ info RUN   '--no-warn-unused-cli',
│ info RUN   '-G',
│ info RUN   'Visual Studio 17 2022',
│ info RUN   '-A',
│ info RUN   'x64',
│ info RUN   '-DCMAKE_JS_VERSION=7.2.1',
│ info RUN   '-DCMAKE_BUILD_TYPE=Release',
│ info RUN   '-DCMAKE_RUNTIME_OUTPUT_DIRECTORY=D:\\pnpm_repo\\global\\5\\.pnpm\\faiss-node@0.2.2\\node_modules\\faiss…
│ info RUN   '-DCMAKE_MSVC_RUNTIME_LIBRARY=MultiThreaded$<$<CONFIG:Debug>:Debug>',
│ info RUN   '-DCMAKE_JS_INC=C:\\Users\\Administrator\\AppData\\Roaming\\npm\\node_modules\\cmake-js\\node_modules\\n…
│ info RUN   '-DCMAKE_JS_SRC=C:/Users/Administrator/AppData/Roaming/npm/node_modules/cmake-js/lib/cpp/win_delay_load_…
│ info RUN   '-DNODE_RUNTIME=node',
│ info RUN   '-DNODE_RUNTIMEVERSION=18.16.1',
│ info RUN   '-DNODE_ARCH=x64',
│ info RUN   '-DCMAKE_JS_LIB=D:\\pnpm_repo\\global\\5\\.pnpm\\faiss-node@0.2.2\\node_modules\\faiss-node\\build\\node…
│ info RUN   '-DCMAKE_JS_NODELIB_DEF=D:\\pnpm_repo\\global\\5\\.pnpm\\faiss-node@0.2.2\\node_modules\\faiss-node\\bui…
│ info RUN   '-DCMAKE_JS_NODELIB_TARGET=D:\\pnpm_repo\\global\\5\\.pnpm\\faiss-node@0.2.2\\node_modules\\faiss-node\\…
│ info RUN   '-DCMAKE_SHARED_LINKER_FLAGS=/DELAYLOAD:NODE.EXE'
│ info RUN ]
│ Not searching for unused variables given on the command line.
│ -- Selecting Windows SDK version 10.0.22000.0 to target Windows 10.0.22621.
│ -- The CXX compiler identification is MSVC 19.36.32535.0
│ -- Detecting CXX compiler ABI info
│ -- Detecting CXX compiler ABI info - done
│ -- Check for working CXX compiler: C:/Program Files (x86)/Microsoft Visual Studio/2022/BuildTools/VC/Tools/MSVC/14.…
│ -- Detecting CXX compile features
│ -- Detecting CXX compile features - done
│ CMake Error at CMakeLists.txt:51 (add_subdirectory):
│   add_subdirectory given source "deps/faiss" which is not an existing
│   directory.
│ CMake Error at CMakeLists.txt:52 (set_target_properties):
│   set_target_properties Can not find target to add properties to: faiss
│ Microsoft (R) Library Manager Version 14.36.32535.0
│ Copyright (C) Microsoft Corporation.  All rights reserved.
│   正在创建库 D:\pnpm_repo\global\5\.pnpm\faiss-node@0.2.2\node_modules\faiss-node\build\node.lib 和对象 D:\pnpm_rep…
│ -- Configuring incomplete, errors occurred!
│ ERR! OMG Process terminated: 1
└─ Failed in 7s at D:\pnpm_repo\global\5\.pnpm\faiss-node@0.2.2\node_modules\faiss-node
 ELIFECYCLE  Command failed with exit code 1.
AlloryDante commented 1 year ago

I think I have the same error for Oracle Cloud - Arm

 info REP Build has been failed, trying to do a full rebuild.
npm ERR! info CMD CLEAN
npm ERR! info RUN [
npm ERR! info RUN   'cmake',
npm ERR! info RUN   '-E',
npm ERR! info RUN   'remove_directory',
npm ERR! info RUN   '/root/node_modules/faiss-node/build'
npm ERR! info RUN ]
npm ERR! info CMD CONFIGURE
npm ERR! info RUN [
npm ERR! info RUN   'cmake',
npm ERR! info RUN   '/root/node_modules/faiss-node',
npm ERR! info RUN   '--no-warn-unused-cli',
npm ERR! info RUN   '-G',
npm ERR! info RUN   'Unix Makefiles',
npm ERR! info RUN   '-DCMAKE_JS_VERSION=7.2.1',
npm ERR! info RUN   '-DCMAKE_BUILD_TYPE=Release',
npm ERR! info RUN   '-DCMAKE_LIBRARY_OUTPUT_DIRECTORY=/root/node_modules/faiss-node/build/Release',
npm ERR! info RUN   '-DCMAKE_MSVC_RUNTIME_LIBRARY=MultiThreaded$<$<CONFIG:Debug>:Debug>',
npm ERR! info RUN   '-DCMAKE_JS_INC=/root/node_modules/faiss-node/node_modules/node-api-headers/include;/root/node_modules/faiss-node/node_modules/node-addon-api',
npm ERR! info RUN   '-DCMAKE_JS_SRC=',
npm ERR! info RUN   '-DNODE_RUNTIME=node',
npm ERR! info RUN   '-DNODE_RUNTIMEVERSION=18.17.0',
npm ERR! info RUN   '-DNODE_ARCH=arm64',
npm ERR! info RUN   '-DCMAKE_JS_LIB=',
npm ERR! info RUN   '-DCMAKE_CXX_FLAGS=-DBUILDING_NODE_EXTENSION'
npm ERR! info RUN ]
npm ERR! CMake Error at CMakeLists.txt:51 (add_subdirectory):
npm ERR!   add_subdirectory given source "deps/faiss" which is not an existing
npm ERR!   directory.
npm ERR! 
npm ERR! 
npm ERR! CMake Error at CMakeLists.txt:52 (set_target_properties):
npm ERR!   set_target_properties Can not find target to add properties to: faiss
npm ERR! 
npm ERR! 
npm ERR! ERR! OMG Process terminated: 1

npm ERR! A complete log of this run can be found in: /root/.npm/_logs/2023-08-02T05_59_52_569Z-debug-0.log
ewfian commented 1 year ago

@adoin From the log provided, it may have something to do with the network. It needs to get the pre-build binary file from github when installing but failed.

│ prebuild-install http request GET https://github.com/ewfian/faiss-node/releases/download/v0.2.2/faiss-node-v0.2.2-n… │ prebuild-install warn install unable to verify the first certificate

You can manual download the pre-build binary with following steps

  1. Uninstall faiss-node and remove node_modules folder
  2. Install faiss-node without auto download pre-build binary by adding --ignore-scripts
    npm install faiss-node --ignore-scripts
  3. Download the corresponding packaged pre-build binary form https://github.com/ewfian/faiss-node/releases
  4. Uncompress the packaged pre-build binary and copy the files into node_modules\faiss-node\build\Release

@AlloryDante seems relates to https://github.com/ewfian/faiss-node/issues/23, you can try again when new version released.