【问题标题】:gyp rebuild fails and linker command failed with exit code 1gyp 重建失败,链接器命令失败,退出代码为 1
【发布时间】:2018-01-04 09:29:27
【问题描述】:

我试图在 react native 项目中安装 npm,但我收到此错误

> weak@1.0.1 install /Users/jopp/Projects/jopp/node_modules/weak
> node-gyp rebuild

  CXX(target) Release/obj.target/weakref/src/weakref.o
clang: warning: using sysroot for 'iPhoneSimulator' but targeting 'MacOSX' [-Wincompatible-sysroot]
  SOLINK_MODULE(target) Release/weakref.node
clang: warning: using sysroot for 'iPhoneSimulator' but targeting 'MacOSX' [-Wincompatible-sysroot]
ld: building for OSX, but linking against dylib built for iOS (/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator11.2.sdk/usr/lib/libc++.tbd). file '/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator11.2.sdk/usr/lib/libc++.tbd' for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
make: *** [Release/weakref.node] Error 1
gyp ERR! build error 
gyp ERR! stack Error: `make` failed with exit code: 2
gyp ERR! stack     at ChildProcess.onExit (/Users/jopp/.nvm/versions/node/v7.10.1/lib/node_modules/npm/node_modules/node-gyp/lib/build.js:276:23)
gyp ERR! stack     at emitTwo (events.js:106:13)
gyp ERR! stack     at ChildProcess.emit (events.js:194:7)
gyp ERR! stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:215:12)
gyp ERR! System Darwin 17.3.0
gyp ERR! command "/Users/jopp/.nvm/versions/node/v7.10.1/bin/node" "/Users/jopp/.nvm/versions/node/v7.10.1/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild"
gyp ERR! cwd /Users/jopp/Projects/jopp/node_modules/weak
gyp ERR! node -v v7.10.1
gyp ERR! node-gyp -v v3.5.0
gyp ERR! not ok

在 android 上一切正常,但在模拟器上无法运行 ios

  • 操作系统:macOS High Sierra
  • 节点:7.10
  • 节点gyp:3.5
  • npm: 4.2

【问题讨论】:

标签: node.js xcode react-native react-native-ios


【解决方案1】:

重启你的机器应该可以解决它

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2022-01-07
    • 2012-09-15
    • 2018-11-03
    • 2015-08-06
    • 2012-05-27
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多