Dmi*_*hok 1 macos bcrypt node-gyp node-pre-gyp apple-m1
我必须安装 bcrypt,但遇到了错误。我尝试了我找到的大部分解决方案。有很多线程,但我在 Mac 上还没有看到很多。\n以下是我从终端得到的内容:
\nyarn install v1.22.11\nwarning ../../../package.json: No license field\ninfo No lockfile found.\n[1/5] Validating package.json...\n[2/5] Resolving packages...\nwarning @types/date-fns@2.6.0: This is a stub types definition for date-fns (https://github.com/date-fns/date-fns). date-fns provides its own type definitions, so you don't need @types/date-fns installed!\nwarning @types/knex@0.16.1: This is a stub types definition. knex provides its own type definitions, so you do not need this installed.\nwarning knex > liftoff > findup-sync > micromatch > snapdragon > source-map-resolve > resolve-url@0.2.1: https://github.com/lydell/resolve-url#deprecated\nwarning knex > liftoff > findup-sync > micromatch > snapdragon > source-map-resolve > urix@0.1.0: Please see https://github.com/lydell/urix#deprecated\nwarning sequelize > uuid@3.4.0: Please upgrade to version 7 or higher. Older versions may use Math.random() in certain circumstances, which is known to be problematic. See https://v8.dev/blog/math-random for details.\nwarning @types/otplib@10.0.0: This is a stub types definition. otplib provides its own type definitions, so you do not need this installed.\n[3/5] Fetching packages...\n[4/5] Linking dependencies...\n[5/5] Building fresh packages...\n[1/4] \xe2\xa2\x80 bcrypt\n[2/4] \xe2\xa2\x80 core-js\n[3/4] \xe2\xa2\x80 nodemon\nerror /Users/raydman/Projects/main inf/backend/node_modules/bcrypt: Command failed.\nExit code: 1\nCommand: node-pre-gyp install --fallback-to-build\nArguments: \nDirectory: /Users/raydman/Projects/main inf/backend/node_modules/bcrypt\nOutput:\nnode-pre-gyp info it worked if it ends with ok\nnode-pre-gyp info using node-pre-gyp@1.0.5\nnode-pre-gyp info using node@16.8.0 | darwin | arm64\nnode-pre-gyp info check checked for "/Users/raydman/Projects/main inf/backend/node_modules/bcrypt/lib/binding/napi-v3/bcrypt_lib.node" (not found)\nnode-pre-gyp http GET https://github.com/kelektiv/node.bcrypt.js/releases/download/v5.0.1/bcrypt_lib-v5.0.1-napi-v3-darwin-arm64-unknown.tar.gz\nnode-pre-gyp ERR! install response status 404 Not Found on https://github.com/kelektiv/node.bcrypt.js/releases/download/v5.0.1/bcrypt_lib-v5.0.1-napi-v3-darwin-arm64-unknown.tar.gz \nnode-pre-gyp WARN Pre-built binaries not installable for bcrypt@5.0.1 and node@16.8.0 (node-v93 ABI, unknown) (falling back to source compile with node-gyp) \nnode-pre-gyp WARN Hit error response status 404 Not Found on https://github.com/kelektiv/node.bcrypt.js/releases/download/v5.0.1/bcrypt_lib-v5.0.1-napi-v3-darwin-arm64-unknown.tar.gz \ngyp info it worked if it ends with ok\ngyp info using node-gyp@7.1.2\ngyp info using node@16.8.0 | darwin | arm64\ngyp info ok \ngyp info it worked if it ends with ok\ngyp info using node-gyp@7.1.2\ngyp info using node@16.8.0 | darwin | arm64\ngyp info find Python using Python version 2.7.16 found at "/System/Library/Frameworks/Python.framework/Versions/2.7/Resources/Python.app/Contents/MacOS/Python"\n(node:7991) [DEP0150] DeprecationWarning: Setting process.config is deprecated. In the future the property will be read-only.\n(Use `node --trace-deprecation ...` to show where the warning was created)\ngyp info spawn /System/Library/Frameworks/Python.framework/Versions/2.7/Resources/Python.app/Contents/MacOS/Python\ngyp info spawn args [\ngyp info spawn args '/usr/local/lib/node_modules/npm/node_modules/node-gyp/gyp/gyp_main.py',\ngyp info spawn args 'binding.gyp',\ngyp info spawn args '-f',\ngyp info spawn args 'make',\ngyp info spawn args '-I',\ngyp info spawn args '/Users/raydman/Projects/main inf/backend/node_modules/bcrypt/build/config.gypi',\ngyp info spawn args '-I',\ngyp info spawn args '/usr/local/lib/node_modules/npm/node_modules/node-gyp/addon.gypi',\ngyp info spawn args '-I',\ngyp info spawn args '/Users/raydman/Library/Caches/node-gyp/16.8.0/include/node/common.gypi',\ngyp info spawn args '-Dlibrary=shared_library',\ngyp info spawn args '-Dvisibility=default',\ngyp info spawn args '-Dnode_root_dir=/Users/raydman/Library/Caches/node-gyp/16.8.0',\ngyp info spawn args '-Dnode_gyp_dir=/usr/local/lib/node_modules/npm/node_modules/node-gyp',\ngyp info spawn args '-Dnode_lib_file=/Users/raydman/Library/Caches/node-gyp/16.8.0/<(target_arch)/node.lib',\ngyp info spawn args '-Dmodule_root_dir=/Users/raydman/Projects/main inf/backend/node_modules/bcrypt',\ngyp info spawn args '-Dnode_engine=v8',\ngyp info spawn args '--depth=.',\ngyp info spawn args '--no-parallel',\ngyp info spawn args '--generator-output',\ngyp info spawn args 'build',\ngyp info spawn args '-Goutput_dir=.'\ngyp info spawn args ]\ngyp info ok \ngyp info it worked if it ends with ok\ngyp info using node-gyp@7.1.2\ngyp info using node@16.8.0 | darwin | arm64\ngyp info spawn make\ngyp info spawn args [ 'BUILDTYPE=Release', '-C', 'build' ]\n CC(target) Release/obj.target/nothing/../node-addon-api/nothing.o\n LIBTOOL-STATIC Release/nothing.a\nwarning: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/libtool: archive library: Release/nothing.a the table of contents is empty (no object file members in the library define global symbols)\n CXX(target) Release/obj.target/bcrypt_lib/src/blowfish.o\nclang: error: no such file or directory: 'inf/backend/node_modules/node-addon-api'\nmake: *** [Release/obj.target/bcrypt_lib/src/blowfish.o] Error 1\ngyp ERR! build error \ngyp ERR! stack Error: `make` failed with exit code: 2\ngyp ERR! stack at ChildProcess.onExit (/usr/local/lib/node_modules/npm/node_modules/node-gyp/lib/build.js:194:23)\ngyp ERR! stack at ChildProcess.emit (node:events:394:28)\ngyp ERR! stack at Process.ChildProcess._handle.onexit (node:internal/child_process:290:12)\ngyp ERR! System Darwin 20.6.0\ngyp ERR! command "/usr/local/bin/node" "/usr/local/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "build" "--fallback-to-build" "--module=/Users/raydman/Projects/main inf/backend/node_modules/bcrypt/lib/binding/napi-v3/bcrypt_lib.node" "--module_name=bcrypt_lib" "--module_path=/Users/raydman/Projects/main inf/backend/node_modules/bcrypt/lib/binding/napi-v3" "--napi_version=8" "--node_abi_napi=napi" "--napi_build_version=3" "--node_napi_label=napi-v3"\ngyp ERR! cwd /Users/raydman/Projects/main inf/backend/node_modules/bcrypt\ngyp ERR! node -v v16.8.0\ngyp ERR! node-gyp -v v7.1.2\ngyp ERR! not ok \nnode-pre-gyp ERR! build error \nnode-pre-gyp ERR! stack Error: Failed to execute '/usr/local/bin/node /usr/local/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js build --fallback-to-build --module=/Users/raydman/Projects/main inf/backend/node_modules/bcrypt/lib/binding/napi-v3/bcrypt_lib.node --module_name=bcrypt_lib --module_path=/Users/raydman/Projects/main inf/backend/node_modules/bcrypt/lib/binding/napi-v3 --napi_version=8 --node_abi_napi=napi --napi_build_version=3 --node_napi_label=napi-v3' (1)\nnode-pre-gyp ERR! stack at ChildProcess.<anonymous> (/Users/raydman/Projects/main inf/backend/node_modules/@mapbox/node-pre-gyp/lib/util/compile.js:89:23)\nnode-pre-gyp ERR! stack at ChildProcess.emit (node:events:394:28)\nnode-pre-gyp ERR! stack at maybeClose (node:internal/child_process:1064:16)\nnode-pre-gyp ERR! stack at Process.ChildProcess._handle.onexit (node:internal/child_process:301:5)\nnode-pre-gyp ERR! System Darwin 20.6.0\nnode-pre-gyp ERR! command "/usr/local/bin/node" "/Users/raydman/Projects/main inf/backend/node_modules/bcrypt/node_modules/.bin/node-pre-gyp" "install" "--fallback-to-build"\nnode-pre-gyp ERR! cwd /Users/raydman/Projects/main inf/backend/node_modules/bcrypt\nnode-pre-gyp ERR! node -v v16.8.0\nnode-pre-gyp ERR! node-pre-gyp -v v1.0.5\nnode-pre-gyp ERR! not ok \nFailed to execute '/usr/local/bin/node /usr/local/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js build --fallback-to-build --module=/Users/raydman/Projects/main inf/backend/node_modules/bcrypt/lib/binding/napi-v3/bcrypt_lib.node --module_name=bcrypt_lib --module_path=/Users/rayd \nRun Code Online (Sandbox Code Playgroud)\n正如你所看到的,它检查了我的 python 2,7,我也使用节点 v16.8.0。错误发生在我这样做之后yarn install。yarn add bcrypt与相同bcryptjs。
| 归档时间: |
|
| 查看次数: |
3384 次 |
| 最近记录: |