反应本机 npm 安装致命错误:找不到'CoreServices/CoreServices.h'文件



当我在react本机项目上运行"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警告已弃用MD5@1.2.2:已弃用,请使用小写'md5@2.x'从现在起npm警告已弃用cross-spawn-async@2.2.4:交叉繁殖不再需要构建工具链,而是使用它!npm警告已弃用lodash-node@2.4.1:此软件包已于停止使用赞成洛达什@^4.0.0。npm WARN生命周期typechecker@2.0.8~预安装:无法在wd%s%s(wd=%s)中运行typechecker@2.0.8节点/cyclic.js/用户/andreahleton/idpractice/node_modules/.stating/typechecker-7c919859npm WARN更喜欢全球cover@0.2.9应该与-g npm一起安装WARN偏爱全球babel@5.8.38应该安装与-g

fsevents@1.0.12install/Users/andreahylston/idvpractice/node_modules/fsevents节点预gyp安装--回退以构建

SOLINK_MODULE(目标)发布/.node CXX(目标)释放/obj.target/fse/fsevents.o SOLINK_MODULE(目标)发布/fse.node副本/用户/andreahleton/idpractice/node_modules/fsevents/lib/binding/Release/node-v48-darwin-x64/fse.nodeTOUCH发布/obj.target/action_after_build.stamp

bufferutil@1.2.1install/Users/andreahleton/idpractice/node_modules/bufferutil节点gyp重建

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

utf-8-validate@1.2.1install/Users/andreahleton/idpractice/node_modules/utf-8-validate节点gyp重建

CXX(目标)发布/obj.target/validation/src/validation.o
SOLINK_MODULE(目标)版本/验证节点

spawn-sync@1.0.15postinstall/Users/andreahleton/idpractice/node_modules/spown sync节点安装后

没有Sudo:

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

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

npm WARN更喜欢全局cover@0.2.9应该与-g npm一起安装WARN偏爱全球babel@5.8.38应该安装与-g

fsevents@1.0.12install/Users/andreahylston/idvpractice/node_modules/fsevents节点预gyp安装--回退以构建

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-2410:36:25.736 xcodebuild[37842:5261935]
XCODE_DEFAULT_TOOLCHAIN_OVERRIDE=/应用程序/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchainSOLINK_MODULE(目标)发布/。节点ld:警告:紧急:正在生成OSX,但与dylib有关(/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/DDeveloper/SDKs/iPhoneSimulator 9.3.sdk/usr/lib/libSystem.dylib)专为iOS构建。注意:这将是一个错误在未来。ld:警告:紧急:为OSX建设,但与dylib联系(/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/DDeveloper/SDKs/iPhoneSimulator 9.3.sdk/usr/lib/libstdc++.dylib)专为iOS构建。注意:这将是一个错误在未来
CXX(目标)发布/obj.target/fse/fsevents.o../fsevents.cc:1:10:致命错误:找不到"CoreServices/CoreServices.h"文件

包括"CoreServices/CoreServices.h">

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

呃!堆栈错误: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.onext(internal/child_Process.js:204:12)gyp ERR!System Darwin 15.5.0 gyp ERR!命令"/usr/local/bin/node"/usr/local/lib/node_modules/npm/node_modules/node gyp/bin/node gyp.js"生成"--回退到生成"--module=/Users/andreahleton/idpractice/node_modules/fsevents/lib/binding/Release/node-v48-darwin-x64/fse.node"--模块名称=fse"--module_path=/Users/andreahlton/idcpractice/node_modules/fsevents/lib/binding/Release/node-v48-darwin-x64"gyp ERR!cwd/Users/andreahleton/idpractice/node_modules/fsevents-gyp呃!node-v v6.1.0 gyp ERR!节点gyp-v v3.3.1 gyp ERR!不好节点预处理错误!生成错误节点pre-gyp ERR!堆栈错误:失败执行'/usr/local/bin/node/usr/local/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.jsbuild—回退到生成--module=/Users/andreahleton/idpractice/node_modules/fsevents/lib/binding/Release/node-v48-darwin-x64/fse.node--模块名称=fse--模块路径=/Users/andreahlton/idcpractice/node_modules/fsevents/lib/binding/Release/node-v48-darwin-x64'(1) 节点预处理错误!在ChildProcess中堆叠。(/Users/andreahleton/idpractice/node_modules/fsevents/node_modules/node pre-gyp/lib/util/compile.js:83:29)node-pre-gyp ERR!emitTwo(events.js:106:13)节点上的堆栈呃!ChildProcess.emit(events.js:191:7)节点上的堆栈呃!maybeClose处的堆栈(internal/child_process.js:850:16)节点预处理错误!Process.ChildProcess.handle.onext处的堆栈(internal/child_process.js:215:5)节点预编译错误!达尔文系统15.5.0节点预编译错误!命令"/usr/local/bin/node"install"--fallback to build"节点预编译错误!cwd/Users/andreahleton/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.jsbuild—回退到生成--module=/Users/andreahleton/idpractice/node_modules/fsevents/lib/binding/Release/node-v48-darwin-x64/fse.node--模块名称=fse--模块路径=/Users/andreahlton/idcpractice/node_modules/fsevents/lib/binding/Release/node-v48-darwin-x64'(1) npm警告安装:fsevents@1.0.12fsevents@1.0.12安装:node-pre-gyp install --fallback-to-buildnpm警告安装:fsevents@1.0.12退出状态1

bufferutil@1.2.1install/Users/andreahleton/idpractice/node_modules/bufferutil节点gyp重建

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-2410:36:38.663 xcodebuild[37889:5262508]
XCODE_DEFAULT_TOOLCHAIN_OVERRIDE=/应用程序/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchainCXX(目标)发布/obj.target/bufferutil/src/bufferutil.o
SOLINK_MODULE(目标)释放/bufferutil.node ld:警告:紧急:为OSX构建,但与dylib链接(/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/DDeveloper/SDKs/iPhoneSimulator 9.3.sdk/usr/lib/libstdc++.dylib)专为iOS构建。注意:这将是一个错误在未来。ld:警告:紧急:为OSX建设,但与dylib联系(/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/DDeveloper/SDKs/iPhoneSimulator 9.3.sdk/usr/lib/libSystem.dylib)专为iOS构建。注意:这将是一个错误在未来。

utf-8-validate@1.2.1install/Users/andreahleton/idpractice/node_modules/utf-8-validate节点gyp重建

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.Xcode默认2016-05-2410:36:42.523 xcodebuild[37965:5262650]
XCODE_DEFAULT_TOOLCHAIN_OVERRIDE=/应用程序/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchainCXX(目标)Release/obj.target/validation/src/validation.o
SOLINK_MODULE(目标)Release/validation.node ld:warning:紧急:为OSX构建,但与dylib链接(/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/DDeveloper/SDKs/iPhoneSimulator 9.3.sdk/usr/lib/libstdc++.dylib)专为iOS构建。注意:这将是一个错误在未来。ld:警告:紧急:为OSX建设,但与dylib联系(/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/DDeveloper/SDKs/iPhoneSimulator 9.3.sdk/usr/lib/libSystem.dylib)专为iOS构建。注意:这将是一个错误在未来。

spawn-sync@1.0.15postinstall/Users/andreahleton/idpractice/node_modules/spown sync节点安装后

我通过删除我的~/.npmrc和~/.npmarc,然后重新启动我的mac,检查这个线程来解决这个问题https://github.com/nodejs/node-gyp/issues/809

最新更新