Cannot install on macbook.

未关闭
#9,079 5 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

还没有人认领这个 Issue。

评估

难度
4/5
预计耗时
3-5 天
新手友好度
28/100
Issue 类型
缺陷
描述清晰度
需要澄清
活跃度
停滞
技术栈
javascript, macos, nodejs

调研方向

首先,在所报告的 macOS Darwin 24.3.0、arm64、Node.js 20.16.0 环境中复现 npm i pouchdb,并检查 leveldown 的 node-gyp 构建失败问题。重点关注日志中显示的缺失 C++ string 头文件。在此环境中成功安装 PouchDB 且不再出现所报告的构建错误,即表示完成。

由索引模型根据 Issue 内容生成。

描述

I cannot run npm i pouchdb

npm warn deprecated [email protected]: Superseded by abstract-level (https://github.com/Level/community#faq)
npm warn deprecated [email protected]: Superseded by abstract-level (https://github.com/Level/community#faq)
npm warn deprecated [email protected]: Superseded by abstract-level (https://github.com/Level/community#faq)
npm warn deprecated [email protected]: Superseded by abstract-level (https://github.com/Level/community#faq)
npm warn deprecated [email protected]: Superseded by abstract-level (https://github.com/Level/community#faq)
npm warn deprecated [email protected]: Superseded by browser-level (https://github.com/Level/community#faq)
npm warn deprecated [email protected]: Superseded by level-transcoder (https://github.com/Level/community#faq)
npm warn deprecated [email protected]: Superseded by abstract-level (https://github.com/Level/community#faq)
npm warn deprecated [email protected]: Superseded by abstract-level (https://github.com/Level/community#faq)
npm warn deprecated [email protected]: Superseded by abstract-level (https://github.com/Level/community#faq)
npm warn deprecated [email protected]: Superseded by abstract-level (https://github.com/Level/community#faq)
npm warn deprecated [email protected]: Superseded by classic-level (https://github.com/Level/community#faq)
npm warn deprecated [email protected]: Superseded by classic-level (https://github.com/Level/community#faq)
npm error code 1
npm error path /Users/steve/sites/tg-trading-bot-master/node_modules/level/node_modules/leveldown
npm error command failed
npm error command sh -c node-gyp-build
npm error CXX(target) Release/obj.target/leveldb/deps/leveldb/leveldb-1.20/db/builder.o
npm error gyp info it worked if it ends with ok
npm error gyp info using [email protected]
npm error gyp info using [email protected] | darwin | arm64
npm error gyp info find Python using Python version 3.13.2 found at "/opt/homebrew/opt/[email protected]/bin/python3.13"
npm error gyp info spawn /opt/homebrew/opt/[email protected]/bin/python3.13
npm error gyp info spawn args [
npm error gyp info spawn args '/Users/steve/.nvm/versions/node/v20.16.0/lib/node_modules/npm/node_modules/node-gyp/gyp/gyp_main.py',
npm error gyp info spawn args 'binding.gyp',
npm error gyp info spawn args '-f',
npm error gyp info spawn args 'make',
npm error gyp info spawn args '-I',
npm error gyp info spawn args '/Users/steve/sites/tg-trading-bot-master/node_modules/level/node_modules/leveldown/build/config.gypi',
npm error gyp info spawn args '-I',
npm error gyp info spawn args '/Users/steve/.nvm/versions/node/v20.16.0/lib/node_modules/npm/node_modules/node-gyp/addon.gypi',
npm error gyp info spawn args '-I',
npm error gyp info spawn args '/Users/steve/Library/Caches/node-gyp/20.16.0/include/node/common.gypi',
npm error gyp info spawn args '-Dlibrary=shared_library',
npm error gyp info spawn args '-Dvisibility=default',
npm error gyp info spawn args '-Dnode_root_dir=/Users/steve/Library/Caches/node-gyp/20.16.0',
npm error gyp info spawn args '-Dnode_gyp_dir=/Users/steve/.nvm/versions/node/v20.16.0/lib/node_modules/npm/node_modules/node-gyp',
npm error gyp info spawn args '-Dnode_lib_file=/Users/steve/Library/Caches/node-gyp/20.16.0/<(target_arch)/node.lib',
npm error gyp info spawn args '-Dmodule_root_dir=/Users/steve/sites/tg-trading-bot-master/node_modules/level/node_modules/leveldown',
npm error gyp info spawn args '-Dnode_engine=v8',
npm error gyp info spawn args '--depth=.',
npm error gyp info spawn args '--no-parallel',
npm error gyp info spawn args '--generator-output',
npm error gyp info spawn args 'build',
npm error gyp info spawn args '-Goutput_dir=.'
npm error gyp info spawn args ]
npm error gyp info spawn make
npm error gyp info spawn args [ 'BUILDTYPE=Release', '-C', 'build' ]
npm error In file included from ../deps/leveldb/leveldb-1.20/db/builder.cc:5:
npm error In file included from ../deps/leveldb/leveldb-1.20/db/builder.h:8:
npm error ../deps/leveldb/leveldb-1.20/include/leveldb/status.h:16:10: fatal error: 'string' file not found
npm error    16 | #include <string>
npm error       |          ^~~~~~~~
npm error 1 error generated.
npm error make: *** [Release/obj.target/leveldb/deps/leveldb/leveldb-1.20/db/builder.o] Error 1
npm error gyp ERR! build error 
npm error gyp ERR! stack Error: `make` failed with exit code: 2
npm error gyp ERR! stack at ChildProcess.<anonymous> (/Users/steve/.nvm/versions/node/v20.16.0/lib/node_modules/npm/node_modules/node-gyp/lib/build.js:209:23)
npm error gyp ERR! System Darwin 24.3.0
npm error gyp ERR! command "/Users/steve/.nvm/versions/node/v20.16.0/bin/node" "/Users/steve/.nvm/versions/node/v20.16.0/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild"
npm error gyp ERR! cwd /Users/steve/sites/tg-trading-bot-master/node_modules/level/node_modules/leveldown
npm error gyp ERR! node -v v20.16.0
npm error gyp ERR! node-gyp -v v10.1.0
npm error gyp ERR! not ok
npm error A complete log of this run can be found in: /Users/steve/.npm/_logs/2025-04-14T13_30_40_360Z-debug-0.log
steve@Stephens-MacBook-Pro tg-trading-bot-master % 
主要语言
JavaScript
星标
17.6k
派生
1.5k
PR 合并指标
30 天内没有已合并 PR

环境准备

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

apache/pouchdb 的其他 Issue

查看 apache/pouchdb 的全部 Issue

相似的 Issue

更多 JavaScript Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。