`yarn` build fails on initial install
未關閉
還沒有人認領這個 Issue。
- 主要語言
- JavaScript
- 星號
- 11.8k
- 分支
- 7.9k
- 平均合併
- 1 天 11 小時
- 30 天內合併 PR
- 11
描述
So I tried to pull this project today and install it for the first time, and I got an error while running yarn.
[-/5] ⠁ waiting...
[-/5] ⠁ waiting...
[-/5] ⠁ waiting...
error /Users/Christopher/Code/reactjs.org/node_modules/sharp: Command failed.
Exit code: 1
Command: node-gyp rebuild
Arguments:
Directory: /Users/Christopher/Code/reactjs.org/node_modules/sharp
Output:
gyp info it worked if it ends with ok
gyp info using node-gyp@3.6.2
gyp info using node@10.1.0 | darwin | x64
gyp info spawn /usr/bin/python
gyp info spawn args [ '/usr/local/Cellar/node/10.1.0/libexec/lib/node_modules/npm/node_modules/node-gyp/gyp/gyp_main.py',
gyp info spawn args 'binding.gyp',
gyp info spawn args '-f',
gyp info spawn args 'make',
gyp info spawn args '-I',
gyp info spawn args '/Users/Christopher/Code/reactjs.org/node_modules/sharp/build/config.gypi',
gyp info spawn args '-I',
gyp info spawn args '/usr/local/Cellar/node/10.1.0/libexec/lib/node_modules/npm/node_modules/node-gyp/addon.gypi',
gyp info spawn args '-I',
gyp info spawn args '/Users/Christopher/.node-gyp/10.1.0/include/node/common.gypi',
gyp info spawn args '-Dlibrary=shared_library',
gyp info spawn args '-Dvisibility=default',
gyp info spawn args '-Dnode_root_dir=/Users/Christopher/.node-gyp/10.1.0',
gyp info spawn args '-Dnode_gyp_dir=/usr/local/Cellar/node/10.1.0/libexec/lib/node_modules/npm/node_modules/node-gyp',
gyp info spawn args '-Dnode_lib_file=/Users/Christopher/.node-gyp/10.1.0/<(target_arch)/node.lib',
gyp info spawn args '-Dmodule_root_dir=/Users/Christopher/Code/reactjs.org/node_modules/sharp',
gyp info spawn args '-Dnode_engine=v8',
gyp info spawn args '--depth=.',
gyp info spawn args '--no-parallel',
gyp info spawn args '--generator-output',
gyp info spawn args 'build',
gyp info spawn args '-Goutput_dir=.' ]
gyp info spawn make
gyp info spawn args [ 'BUILDTYPE=Release', '-C', 'build' ]
TOUCH Release/obj.target/libvips-cpp.stamp
CXX(target) Release/obj.target/sharp/src/common.o
In file included from ../src/common.cc:22:
In file included from ../../nan/nan.h:192:
../../nan/nan_maybe_43_inl.h:112:15: error: no member named 'ForceSet' in 'v8::Object'
return obj->ForceSet(isolate->GetCurrentContext(), key, value, attribs);
~~~ ^
In file included from ../src/common.cc:22:
../../nan/nan.h:834:18: warning: 'MakeCallback' is deprecated: Use MakeCallback(..., async_context) [-Wdeprecated-declarations]
return node::MakeCallback(
^
/Users/Christopher/.node-gyp/10.1.0/include/node/node.h:171:1: note: 'MakeCallback' has been explicitly marked deprecated here
NODE_DEPRECATED("Use MakeCallback(..., async_context)",
^
/Users/Christopher/.node-gyp/10.1.0/include/node/node.h:88:20: note: expanded from macro 'NODE_DEPRECATED'
__attribute__((deprecated(message))) declarator
^
In file included from ../src/common.cc:22:
../../nan/nan.h:849:18: warning: 'MakeCallback' is deprecated: Use MakeCallback(..., async_context) [-Wdeprecated-declarations]
return node::MakeCallback(
^
/Users/Christopher/.node-gyp/10.1.0/include/node/node.h:164:1: note: 'MakeCallback' has been explicitly marked deprecated here
NODE_DEPRECATED("Use MakeCallback(..., async_context)",
^
/Users/Christopher/.node-gyp/10.1.0/include/node/node.h:88:20: note: expanded from macro 'NODE_DEPRECATED'
__attribute__((deprecated(message))) declarator
^
In file included from ../src/common.cc:22:
../../nan/nan.h:864:18: warning: 'MakeCallback' is deprecated: Use MakeCallback(..., async_context) [-Wdeprecated-declarations]
return node::MakeCallback(
^
/Users/Christopher/.node-gyp/10.1.0/include/node/node.h:157:1: note: 'MakeCallback' has been explicitly marked deprecated here
NODE_DEPRECATED("Use MakeCallback(..., async_context)",
^
/Users/Christopher/.node-gyp/10.1.0/include/node/node.h:88:20: note: expanded from macro 'NODE_DEPRECATED'
__attribute__((deprecated(message))) declarator
^
In file included from ../src/common.cc:22:
../../nan/nan.h:1473:31: warning: 'MakeCallback' is deprecated: Use MakeCallback(..., async_context) [-Wdeprecated-declarations]
return scope.Escape(node::MakeCallback(
^
/Users/Christopher/.node-gyp/10.1.0/include/node/node.h:171:1: note: 'MakeCallback' has been explicitly marked deprecated here
NODE_DEPRECATED("Use MakeCallback(..., async_context)",
^
/Users/Christopher/.node-gyp/10.1.0/include/node/node.h:88:20: note: expanded from macro 'NODE_DEPRECATED'
__attribute__((deprecated(message))) declarator
^
4 warnings and 1 error generated.
make: *** [Release/obj.target/sharp/src/common.o] Error 1
gyp ERR! build error
gyp ERR! stack Error: `make` failed with exit code: 2
gyp ERR! stack at ChildProcess.onExit (/usr/local/Cellar/node/10.1.0/libexec/lib/node_modules/npm/node_modules/node-gyp/lib/build.js:258:23)
gyp ERR! stack at ChildProcess.emit (events.js:182:13)
gyp ERR! stack at Process.ChildProcess._handle.onexit (internal/child_process.js:235:12)
gyp ERR! System Darwin 17.4.0
gyp ERR! command "/usr/local/Cellar/node/10.1.0/bin/node" "/usr/local/Cellar/node/10.1.0/libexec/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild"
gyp ERR! cwd /Users/Christopher/Code/reactjs.org/node_modules/sharp
Here's my node version:
> Christopher@Tamiasiii: ~/Code/reactjs.org> node --version
v10.1.0
This similar issue from mattermost seems like it was resolved by bumping the nan version.
I'd make a PR to do that but TBH I'm really out of my depth here. I can't even find where that would be done
https://github.com/mattermost/mattermost-server/issues/8708
貢獻指南
從這裡開始
- 先讀完整個 Issue,再讀專案的貢獻指南。
- 在 Issue 下留言說明你要接手 —— 這能避免兩個人做同樣的事。
- Fork 儲存庫,在一個分支上完成修改。
- 送出 Pull Request,並在描述裡引用這個 Issue 編號。
研究方向
首先重現初始的 yarn 安裝,並檢查 node_modules/sharp 的建置路徑,包括 binding.gyp、src/common.cc 和所參照的 nan.h。當在 Node 10.1.0 上完成乾淨安裝且不再出現 node-gyp rebuild 錯誤時,此 issue 即完成。
由索引模型根據 Issue 內容生成。
評估
- 技術堆疊
- javascript, node.js
- 領域
- build-system
- Issue 類型
- 缺陷
- 難度
- 3/5
- 預估耗時
- 1-2 天
- 活躍度
- 停滯
- 描述清晰度
- 基本清楚
- 新手友好度
- 25/100