React-native npm install致命错误:' CoreServices / CoreServices.h'找不到档案

时间:2016-05-24 16:54:41

标签: react-native

当我跑步" npm install"在我的本机反应项目中,当我不使用sudo运行时,我会遇到错误。注意,当我运行Facebook初始化项目时,我遇到同样的问题" react-native init AwesomeProject"。

这个问题是新问题,到目前为止我已尝试过:

- re-installing xcode v7.3.1 (7D1014)
- re-installing node-v6.2.0 (npm v3.8.9)
- downgrading to node-v6.1.0 (npm v3.8.6)
- removing node version manager (nvm)

净效应是npm不安装fsevents@1.0.12。

├─┬ react-native@0.24.0 
│ ├─┬ fbjs-scripts@0.4.0 
│ │ ├─┬ babel@5.8.38 
│ │ │ ├─┬ chokidar@1.5.1 
│ │ │ │ ├─┬ fsevents@1.0.12 

使用Sudo:

  

npm WARN弃用MD5@1.2.2:弃用,使用小写' md5@2.x'   从现在起npm WARN弃用了cross-spawn-async@2.2.4:cross-spawn   不再需要构建工具链,而是使用它!警告   不推荐使用lodash-node@2.4.1:此软件包已停止使用   赞成lodash@^4.0.0。 npm WARN生命周期   typechecker@2.0.8 ~preinstall:无法在wd%s%s中运行(wd =%s)   typechecker@2.0.8 node ./cyclic.js   /Users/andreahylton/idpractice/node_modules/.staging/typechecker-7c919859   npm WARN首选全局cover@0.2.9应与-g npm一起安装   WARN首选全球babel@5.8.38应与-g

一起安装      
    

fsevents@1.0.12 install / Users / andreahylton / idpractice / node_modules / fsevents     node-pre-gyp install --fallback-to-build

  
     

SOLINK_MODULE(目标)发布/ .node CXX(目标)   发布/ obj.target / fse / fsevents.o SOLINK_MODULE(目标)   发布/ fse.node COPY   /Users/andreahylton/idpractice/node_modules/fsevents/lib/binding/Release/node-v48-darwin-x64/fse.node   TOUCH Release / obj.target / action_after_build.stamp

     
    

bufferutil@1.2.1 install / Users / andreahylton / idpractice / node_modules / bufferutil     node-gyp rebuild

  
     

CXX(目标)发布/ obj.target / bufferutil / src / bufferutil.o
  SOLINK_MODULE(目标)发布/ bufferutil.node

     
    

utf-8-validate@1.2.1 install / Users / andreahylton / idpractice / node_modules / utf-8-validate     node-gyp rebuild

  
     

CXX(目标)发布/ obj.target / validation / src / validation.o
  SOLINK_MODULE(目标)发布/验证.node

     
    

spawn-sync@1.0.15 postinstall / Users / andreahylton / idpractice / node_modules / spawn-sync     node postinstall

  

没有Sudo:

  

npm WARN弃用MD5@1.2.2:弃用,使用小写' md5@2.x'   从现在起npm WARN弃用了cross-spawn-async@2.2.4:cross-spawn   不再需要构建工具链,而是使用它!警告   不推荐使用lodash-node@2.4.1:此软件包已停止使用   赞成lodash@^4.0.0。

     
    

typechecker@2.0.8预安装/Users/andreahylton/idpractice/node_modules/.staging/typechecker-7c919859     节点./cyclic.js

  
     

npm WARN首选全局cover@0.2.9应该与-g npm一起安装   WARN首选全球babel@5.8.38应与-g

一起安装      
    

fsevents@1.0.12 install / Users / andreahylton / idpractice / node_modules / fsevents     node-pre-gyp install --fallback-to-build

  
     

2016-05-24 10:36:25.735 xcodebuild [37842:5261935]从中构建设置   命令行:2016-05-24 10:36:25.736 xcodebuild [37842:5261935]
  TOOLCHAINS = com.apple.dt.toolchain.XcodeDefault 2016-05-24   10:36:25.736 xcodebuild [37842:5261935]
  XCODE_DEFAULT_TOOLCHAIN_OVERRIDE =   /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain   SOLINK_MODULE(target)Release / .node ld:warning:URGENT:build for   OSX,但链接dylib   (/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator9.3.sdk/usr/lib/libSystem.dylib)   专为iOS而打造。注意:将来这将是一个错误。 ld:警告:   紧急:为OSX构建,但是与dylib链接   (/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator9.3.sdk/usr/lib/libstdc++.dylib)   专为iOS而打造。注意:将来这将是一个错误   CXX(目标)发布/ obj.target / fse / fsevents.o ../fsevents.cc:11:10:   致命错误:' CoreServices / CoreServices.h'找不到文件

     

包括" CoreServices / CoreServices.h"

     ^ 1 error generated. make: *** [Release/obj.target/fse/fsevents.o] Error 1 gyp ERR! build error  gyp
     

ERR!堆栈错误:make失败并退出代码:2 gyp ERR!堆栈
  在ChildProcess.onExit   (/usr/local/lib/node_modules/npm/node_modules/node-gyp/lib/build.js:276:23)   gyp ERR!堆栈在emitTwo(events.js:106:13)gyp ERR!堆栈在   ChildProcess.emit(events.js:191:7)gyp ERR!堆栈在   Process.ChildProcess._handle.onexit(internal / child_process.js:204:12)   gyp ERR!系统达尔文15.5.0 gyp ERR!命令" / usr / local / bin / node"   " /usr/local/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js"   "建立" " - 后退到构建"   " - 模块= /用户/ andreahylton / idpractice / node_modules / fsevents / LIB /结合/释放/节点-V48-达尔文-X64 / fse.node"   " - MODULE_NAME = FSE"   " - module_path中= /用户/ andreahylton / idpractice / node_modules / fsevents / LIB /结合/释放/节点-V48-达尔文-64"   gyp ERR! cwd / Users / andreahylton / idpractice / node_modules / fsevents gyp   呃! node -v v6.1.0 gyp ERR! node-gyp -v v3.3.1 gyp ERR!不好   node-pre-gyp ERR!构建错误node-pre-gyp ERR!堆栈错误:失败   执行' / usr / local / bin / node   /usr/local/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js   build - fallback-to-build   --module = /用户/ andreahylton / idpractice / node_modules / fsevents / LIB /结合/释放/节点-V48-达尔文-X64 / fse.node   --module_name = fse --module_path = / Users / andreahylton / idpractice / node_modules / fsevents / lib / binding / Release / node-v48-darwin-x64'   (1)node-pre-gyp ERR!在ChildProcess堆栈。   (/Users/andreahylton/idpractice/node_modules/fsevents/node_modules/node-pre-gyp/lib/util/compile.js:83:29)node-pre-gyp ERR!堆栈在emitTwo(events.js:106:13)node-pre-gyp   呃!堆栈在ChildProcess.emit(events.js:191:7)node-pre-gyp   呃!在maybeClose堆栈(内部/ child_process.js:850:16)   node-pre-gyp ERR!在Process.ChildProcess._handle.onexit堆栈   (internal / child_process.js:215:5)node-pre-gyp ERR!系统达尔文   15.5.0 node-pre-gyp ERR!命令" / usr / local / bin / node" " /Users/andreahylton/idpractice/node_modules/fsevents/node_modules/.bin/node-pre-gyp"   "安装" " - 后退到构建" node-pre-gyp ERR! CWD   / Users / andreahylton / idpractice / node_modules / fsevents node-pre-gyp ERR!   node -v v6.1.0 node-pre-gyp ERR! node-pre-gyp -v v0.6.25 node-pre-gyp   呃!不行无法执行' / usr / local / bin / node   /usr/local/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js   build - fallback-to-build   --module = /用户/ andreahylton / idpractice / node_modules / fsevents / LIB /结合/释放/节点-V48-达尔文-X64 / fse.node   --module_name = fse --module_path = / Users / andreahylton / idpractice / node_modules / fsevents / lib / binding / Release / node-v48-darwin-x64'   (1)npm WARN安装:fsevents@1.0.12 fsevents@1.0.12安装:   node-pre-gyp install --fallback-to-build npm警告   安装:fsevents@1.0.12退出状态1

     
    

bufferutil@1.2.1 install / Users / andreahylton / idpractice / node_modules / bufferutil     node-gyp rebuild

  
     

2016-05-24 10:36:38.662 xcodebuild [37889:5262508]从中构建设置   命令行:2016-05-24 10:36:38.663 xcodebuild [37889:5262508]
  TOOLCHAINS = com.apple.dt.toolchain.XcodeDefault 2016-05-24   10:36:38.663 xcodebuild [37889:5262508]
  XCODE_DEFAULT_TOOLCHAIN_OVERRIDE =   /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain   CXX(目标)发布/ obj.target / bufferutil / src / bufferutil.o
  SOLINK_MODULE(target)Release / bufferutil.node ld:warning:URGENT:   为OSX构建,但链接到dylib   (/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator9.3.sdk/usr/lib/libstdc++.dylib)   专为iOS而打造。注意:将来这将是一个错误。 ld:警告:   紧急:为OSX构建,但是与dylib链接   (/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator9.3.sdk/usr/lib/libSystem.dylib)   专为iOS而打造。注意:将来这将是一个错误。

     
    

utf-8-validate@1.2.1 install / Users / andreahylton / idpractice / node_modules / utf-8-validate     node-gyp rebuild

  
     

2016-05-24 10:36:42.522 xcodebuild [37965:5262650]从中构建设置   命令行:2016-05-24 10:36:42.523 xcodebuild [37965:5262650]
  TOOLCHAINS = com.apple.dt.toolchain.XcodeDefault 2016-05-24   10:36:42.523 xcodebuild [37965:5262650]
  XCODE_DEFAULT_TOOLCHAIN_OVERRIDE =   /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain   CXX(目标)发布/ obj.target / validation / src / validation.o
  SOLINK_MODULE(target)Release / validation.node ld:warning:URGENT:   为OSX构建,但链接到dylib   (/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator9.3.sdk/usr/lib/libstdc++.dylib)   专为iOS而打造。注意:将来这将是一个错误。 ld:警告:   紧急:为OSX构建,但是与dylib链接   (/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator9.3.sdk/usr/lib/libSystem.dylib)   专为iOS而打造。注意:将来这将是一个错误。

     
    

spawn-sync@1.0.15 postinstall / Users / andreahylton / idpractice / node_modules / spawn-sync     node postinstall

  

1 个答案:

答案 0 :(得分:1)

我通过删除我的〜/ .node-gyp和〜/ .npmrc来修复此问题,然后重新启动我的mac,看看这个帖子https://github.com/nodejs/node-gyp/issues/809