我试图在我的 mac m1 上安装 sqlite3 模块,但它给了我很多错误。是的,我已经安装了 xcode 并且是最新的。我尝试使用 sudo npm i,并且还从根目录中删除了 .node-gyp 文件夹。我能够将相同的代码库发送到另一台非 m1 mac,并且安装顺利。
我也在节点 v14.x 上
npm ERR! code 1
npm ERR! path /Users/nathanleggatt/Projects/chimp/node_modules/sqlite3
npm ERR! command failed
npm ERR! command sh -c node-pre-gyp install --fallback-to-build
npm ERR! ACTION deps_sqlite3_gyp_action_before_build_target_unpack_sqlite_dep Release/obj/gen/sqlite-autoconf-3300100/sqlite3.c
npm ERR! TOUCH Release/obj.target/deps/action_before_build.stamp
npm ERR! CC(target) Release/obj.target/sqlite3/gen/sqlite-autoconf-3300100/sqlite3.o
npm ERR! LIBTOOL-STATIC Release/sqlite3.a
npm ERR! 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/nathanleggatt/Projects/chimp/node_modules/sqlite3/lib/binding/node-v83-darwin-x64/node_sqlite3.node --module_name=node_sqlite3 --module_path=/Users/nathanleggatt/Projects/chimp/node_modules/sqlite3/lib/binding/node-v83-darwin-x64 --napi_version=7 --node_abi_napi=napi --napi_build_version=0 --node_napi_label=node-v83' (1)
npm ERR! node-pre-gyp info it worked if it ends with ok
npm ERR! node-pre-gyp info using node-pre-gyp@0.11.0
npm ERR! node-pre-gyp info using node@14.15.3 | darwin | x64
npm ERR! node-pre-gyp WARN Using request for node-pre-gyp https download
npm ERR! node-pre-gyp info check checked for "/Users/nathanleggatt/Projects/chimp/node_modules/sqlite3/lib/binding/node-v83-darwin-x64/node_sqlite3.node" (not found)
npm ERR! node-pre-gyp http GET https://mapbox-node-binary.s3.amazonaws.com/sqlite3/v4.1.1/node-v83-darwin-x64.tar.gz
npm ERR! node-pre-gyp http 403 https://mapbox-node-binary.s3.amazonaws.com/sqlite3/v4.1.1/node-v83-darwin-x64.tar.gz
npm ERR! node-pre-gyp WARN Tried to download(403): https://mapbox-node-binary.s3.amazonaws.com/sqlite3/v4.1.1/node-v83-darwin-x64.tar.gz
npm ERR! node-pre-gyp WARN Pre-built binaries not found for sqlite3@4.1.1 and node@14.15.3 (node-v83 ABI, unknown) (falling back to source compile with node-gyp)
npm ERR! node-pre-gyp http 403 status code downloading tarball https://mapbox-node-binary.s3.amazonaws.com/sqlite3/v4.1.1/node-v83-darwin-x64.tar.gz
npm ERR! gyp info it worked if it ends with ok
npm ERR! gyp info using node-gyp@8.4.1
npm ERR! gyp info using node@14.15.3 | darwin | x64
npm ERR! gyp info ok
npm ERR! gyp info it worked if it ends with ok
npm ERR! gyp info using node-gyp@8.4.1
npm ERR! gyp info using node@14.15.3 | darwin | x64
npm ERR! gyp info find Python using Python version 3.9.10 found at "/usr/local/opt/python@3.9/bin/python3.9"
npm ERR! gyp info spawn /usr/local/opt/python@3.9/bin/python3.9
npm ERR! gyp info spawn args [
npm ERR! gyp info spawn args '/usr/local/lib/node_modules/npm/node_modules/node-gyp/gyp/gyp_main.py',
npm ERR! gyp info spawn args 'binding.gyp',
npm ERR! gyp info spawn args '-f',
npm ERR! gyp info spawn args 'make',
npm ERR! gyp info spawn args '-I',
npm ERR! gyp info spawn args '/Users/nathanleggatt/Projects/chimp/node_modules/sqlite3/build/config.gypi',
npm ERR! gyp info spawn args '-I',
npm ERR! gyp info spawn args '/usr/local/lib/node_modules/npm/node_modules/node-gyp/addon.gypi',
npm ERR! gyp info spawn args '-I',
npm ERR! gyp info spawn args '/Users/nathanleggatt/Library/Caches/node-gyp/14.15.3/include/node/common.gypi',
npm ERR! gyp info spawn args '-Dlibrary=shared_library',
npm ERR! gyp info spawn args '-Dvisibility=default',
npm ERR! gyp info spawn args '-Dnode_root_dir=/Users/nathanleggatt/Library/Caches/node-gyp/14.15.3',
npm ERR! gyp info spawn args '-Dnode_gyp_dir=/usr/local/lib/node_modules/npm/node_modules/node-gyp',
npm ERR! gyp info spawn args '-Dnode_lib_file=/Users/nathanleggatt/Library/Caches/node-gyp/14.15.3/<(target_arch)/node.lib',
npm ERR! gyp info spawn args '-Dmodule_root_dir=/Users/nathanleggatt/Projects/chimp/node_modules/sqlite3',
npm ERR! gyp info spawn args '-Dnode_engine=v8',
npm ERR! gyp info spawn args '--depth=.',
npm ERR! gyp info spawn args '--no-parallel',
npm ERR! gyp info spawn args '--generator-output',
npm ERR! gyp info spawn args 'build',
npm ERR! gyp info spawn args '-Goutput_dir=.'
npm ERR! gyp info spawn args ]
npm ERR! gyp info ok
npm ERR! gyp info it worked if it ends with ok
npm ERR! gyp info using node-gyp@8.4.1
npm ERR! gyp info using node@14.15.3 | darwin | x64
npm ERR! gyp info spawn make
npm ERR! gyp info spawn args [ 'BUILDTYPE=Release', '-C', 'build' ]
npm ERR! libtool: unrecognized option `-static'
npm ERR! libtool: Try `libtool --help' for more information.
npm ERR! make: *** [Release/sqlite3.a] Error 1
npm ERR! gyp ERR! build error
npm ERR! gyp ERR! stack Error: `make` failed with exit code: 2
npm ERR! gyp ERR! stack at ChildProcess.onExit (/usr/local/lib/node_modules/npm/node_modules/node-gyp/lib/build.js:194:23)
npm ERR! gyp ERR! stack at ChildProcess.emit (events.js:315:20)
npm ERR! gyp ERR! stack at Process.ChildProcess._handle.onexit (internal/child_process.js:277:12)
npm ERR! gyp ERR! System Darwin 20.3.0
npm ERR! gyp 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/nathanleggatt/Projects/chimp/node_modules/sqlite3/lib/binding/node-v83-darwin-x64/node_sqlite3.node" "--module_name=node_sqlite3" "--module_path=/Users/nathanleggatt/Projects/chimp/node_modules/sqlite3/lib/binding/node-v83-darwin-x64" "--napi_version=7" "--node_abi_napi=napi" "--napi_build_version=0" "--node_napi_label=node-v83"
npm ERR! gyp ERR! cwd /Users/nathanleggatt/Projects/chimp/node_modules/sqlite3
npm ERR! gyp ERR! node -v v14.15.3
npm ERR! gyp ERR! node-gyp -v v8.4.1
npm ERR! gyp ERR! not ok
npm ERR! node-pre-gyp ERR! build error
npm ERR! node-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/nathanleggatt/Projects/chimp/node_modules/sqlite3/lib/binding/node-v83-darwin-x64/node_sqlite3.node --module_name=node_sqlite3 --module_path=/Users/nathanleggatt/Projects/chimp/node_modules/sqlite3/lib/binding/node-v83-darwin-x64 --napi_version=7 --node_abi_napi=napi --napi_build_version=0 --node_napi_label=node-v83' (1)
npm ERR! node-pre-gyp ERR! stack at ChildProcess.<anonymous> (/Users/nathanleggatt/Projects/chimp/node_modules/node-pre-gyp/lib/util/compile.js:83:29)
npm ERR! node-pre-gyp ERR! stack at ChildProcess.emit (events.js:315:20)
npm ERR! node-pre-gyp ERR! stack at maybeClose (internal/child_process.js:1048:16)
npm ERR! node-pre-gyp ERR! stack at Process.ChildProcess._handle.onexit (internal/child_process.js:288:5)
npm ERR! node-pre-gyp ERR! System Darwin 20.3.0
npm ERR! node-pre-gyp ERR! command "/usr/local/bin/node" "/Users/nathanleggatt/Projects/chimp/node_modules/.bin/node-pre-gyp" "install" "--fallback-to-build"
npm ERR! node-pre-gyp ERR! cwd /Users/nathanleggatt/Projects/chimp/node_modules/sqlite3
npm ERR! node-pre-gyp ERR! node -v v14.15.3
npm ERR! node-pre-gyp ERR! node-pre-gyp -v v0.11.0
npm ERR! node-pre-gyp ERR! not ok
npm ERR! A complete log of this run can be found in:
npm ERR! /Users/nathanleggatt/.npm/_logs/2022-01-27T06_39_15_358Z-debug-0.log
Run Code Online (Sandbox Code Playgroud)
小智 11
这个为我解决了这个问题:
npm config set python "$(which python3)" # or whichever version you use
Run Code Online (Sandbox Code Playgroud)
解决方案取自此 github 问题。
小智 4
我在尝试安装 Truffle (Consensys) 时遇到了同样的问题,我认为这与 sqlite3 库未提供服务有关。
您的脚本正在尝试下载它,但链接不起作用:
> npm ERR! node-pre-gyp http GET https://mapbox-node-binary.s3.amazonaws.com/sqlite3/v4.1.1/node-v83-darwin-x64.tar.gz
> npm ERR! node-pre-gyp http 403 https://mapbox-node-binary.s3.amazonaws.com/sqlite3/v4.1.1/node-v83-darwin-x64.tar.gz
Run Code Online (Sandbox Code Playgroud)
如果我手动浏览它,则会收到错误:
他们的 github 上已经报告了一个问题:
我尝试了有关此问题的各种存储库中提出的解决方法(文件无法访问),但到目前为止没有一个对我有用。
| 归档时间: |
|
| 查看次数: |
5559 次 |
| 最近记录: |