title: React-native npm install fatal error: 'CoreServices/CoreServices.h' file not found
body: <p>When I run "npm install" on my react-native project, I get errors when I don't run with sudo.  Note, I get the same problem when I run the Facebook starter project "react-native init AwesomeProject".</p>
  
  <p>This problem is new and so far I've tried:</p>
  
  <pre><code>- 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)
  </code></pre>
  
  <p>The net effect is that npm doesn't install fsevents@1.0.12.  </p>
  
  <pre><code>├─┬ react-native@0.24.0 
  │ ├─┬ fbjs-scripts@0.4.0 
  │ │ ├─┬ babel@5.8.38 
  │ │ │ ├─┬ chokidar@1.5.1 
  │ │ │ │ ├─┬ fsevents@1.0.12 
  </code></pre>
  
  <p><strong>With Sudo:</strong></p>
  
  <blockquote>
    <p>npm WARN deprecated MD5@1.2.2: deprecated, use lowercase 'md5@2.x'
    from now on npm WARN deprecated cross-spawn-async@2.2.4: cross-spawn
    no longer requires a build toolchain, use it instead! npm WARN
    deprecated lodash-node@2.4.1: This package has been discontinued in
    favor of lodash@^4.0.0. npm WARN lifecycle
    typechecker@2.0.8~preinstall: cannot run in wd %s %s (wd=%s)
    typechecker@2.0.8 node ./cyclic.js
    /Users/andreahylton/idpractice/node_modules/.staging/typechecker-7c919859
    npm WARN prefer global cover@0.2.9 should be installed with -g npm
    WARN prefer global babel@5.8.38 should be installed with -g</p>
    
    <blockquote>
      <p>fsevents@1.0.12 install /Users/andreahylton/idpractice/node_modules/fsevents
      node-pre-gyp install --fallback-to-build</p>
    </blockquote>
    
    <p>SOLINK_MODULE(target) Release/.node   CXX(target)
    Release/obj.target/fse/fsevents.o   SOLINK_MODULE(target)
    Release/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</p>
    
    <blockquote>
      <p>bufferutil@1.2.1 install /Users/andreahylton/idpractice/node_modules/bufferutil
      node-gyp rebuild</p>
    </blockquote>
    
    <p>CXX(target) Release/obj.target/bufferutil/src/bufferutil.o<br>
    SOLINK_MODULE(target) Release/bufferutil.node</p>
    
    <blockquote>
      <p>utf-8-validate@1.2.1 install /Users/andreahylton/idpractice/node_modules/utf-8-validate
      node-gyp rebuild</p>
    </blockquote>
    
    <p>CXX(target) Release/obj.target/validation/src/validation.o<br>
    SOLINK_MODULE(target) Release/validation.node</p>
    
    <blockquote>
      <p>spawn-sync@1.0.15 postinstall /Users/andreahylton/idpractice/node_modules/spawn-sync
      node postinstall</p>
    </blockquote>
  </blockquote>
  
  <p><strong>Without Sudo:</strong></p>
  
  <blockquote>
    <p>npm WARN deprecated MD5@1.2.2: deprecated, use lowercase 'md5@2.x'
    from now on npm WARN deprecated cross-spawn-async@2.2.4: cross-spawn
    no longer requires a build toolchain, use it instead! npm WARN
    deprecated lodash-node@2.4.1: This package has been discontinued in
    favor of lodash@^4.0.0.</p>
    
    <blockquote>
      <p>typechecker@2.0.8 preinstall /Users/andreahylton/idpractice/node_modules/.staging/typechecker-7c919859
      node ./cyclic.js</p>
    </blockquote>
    
    <p>npm WARN prefer global cover@0.2.9 should be installed with -g npm
    WARN prefer global babel@5.8.38 should be installed with -g</p>
    
    <blockquote>
      <p>fsevents@1.0.12 install /Users/andreahylton/idpractice/node_modules/fsevents
      node-pre-gyp install --fallback-to-build</p>
    </blockquote>
    
    <p>2016-05-24 10:36:25.735 xcodebuild[37842:5261935] Build settings from
    command line: 2016-05-24 10:36:25.736 xcodebuild[37842:5261935]<br>
    TOOLCHAINS = com.apple.dt.toolchain.XcodeDefault 2016-05-24
    10:36:25.736 xcodebuild[37842:5261935]<br>
    XCODE_DEFAULT_TOOLCHAIN_OVERRIDE =
    /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain
    SOLINK_MODULE(target) Release/.node ld: warning: URGENT: building for
    OSX, but linking against dylib
    (/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator9.3.sdk/usr/lib/libSystem.dylib)
    built for iOS. Note: This will be an error in the future. ld: warning:
    URGENT: building for OSX, but linking against dylib
    (/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator9.3.sdk/usr/lib/libstdc++.dylib)
    built for iOS. Note: This will be an error in the future.<br>
    CXX(target) Release/obj.target/fse/fsevents.o ../fsevents.cc:11:10:
    fatal error: 'CoreServices/CoreServices.h' file not found</p>
    
    <h1>include "CoreServices/CoreServices.h"</h1>
  
  <pre><code>     ^ 1 error generated. make: *** [Release/obj.target/fse/fsevents.o] Error 1 gyp ERR! build error  gyp
  </code></pre>
    
    <p>ERR! stack Error: <code>make</code> failed with exit code: 2 gyp ERR! stack<br>
    at ChildProcess.onExit
    (/usr/local/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:191:7) gyp ERR! stack     at
    Process.ChildProcess._handle.onexit (internal/child_process.js:204:12)
    gyp ERR! System Darwin 15.5.0 gyp ERR! command "/usr/local/bin/node"
    "/usr/local/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js"
    "build" "--fallback-to-build"
    "--module=/Users/andreahylton/idpractice/node_modules/fsevents/lib/binding/Release/node-v48-darwin-x64/fse.node"
    "--module_name=fse"
    "--module_path=/Users/andreahylton/idpractice/node_modules/fsevents/lib/binding/Release/node-v48-darwin-x64"
    gyp ERR! cwd /Users/andreahylton/idpractice/node_modules/fsevents gyp
    ERR! node -v v6.1.0 gyp ERR! node-gyp -v v3.3.1 gyp ERR! not ok 
    node-pre-gyp ERR! build error  node-pre-gyp ERR! stack Error: Failed
    to execute '/usr/local/bin/node
    /usr/local/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js
    build --fallback-to-build
    --module=/Users/andreahylton/idpractice/node_modules/fsevents/lib/binding/Release/node-v48-darwin-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! stack     at ChildProcess.
    (/Users/andreahylton/idpractice/node_modules/fsevents/node_modules/node-pre-gyp/lib/util/compile.js:83:29) node-pre-gyp ERR! stack     at emitTwo (events.js:106:13) node-pre-gyp
    ERR! stack     at ChildProcess.emit (events.js:191:7) node-pre-gyp
    ERR! stack     at maybeClose (internal/child_process.js:850:16)
    node-pre-gyp ERR! stack     at Process.ChildProcess._handle.onexit
    (internal/child_process.js:215:5) node-pre-gyp ERR! System Darwin
    15.5.0 node-pre-gyp ERR! command "/usr/local/bin/node" "/Users/andreahylton/idpractice/node_modules/fsevents/node_modules/.bin/node-pre-gyp"
    "install" "--fallback-to-build" 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
    ERR! not ok  Failed to execute '/usr/local/bin/node
    /usr/local/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js
    build --fallback-to-build
    --module=/Users/andreahylton/idpractice/node_modules/fsevents/lib/binding/Release/node-v48-darwin-x64/fse.node
    --module_name=fse --module_path=/Users/andreahylton/idpractice/node_modules/fsevents/lib/binding/Release/node-v48-darwin-x64'
    (1) npm WARN install:fsevents@1.0.12 fsevents@1.0.12 install:
    <code>node-pre-gyp install --fallback-to-build</code> npm WARN
    install:fsevents@1.0.12 Exit status 1</p>
    
    <blockquote>
      <p>bufferutil@1.2.1 install /Users/andreahylton/idpractice/node_modules/bufferutil
      node-gyp rebuild</p>
    </blockquote>
    
    <p>2016-05-24 10:36:38.662 xcodebuild[37889:5262508] Build settings from
    command line: 2016-05-24 10:36:38.663 xcodebuild[37889:5262508]<br>
    TOOLCHAINS = com.apple.dt.toolchain.XcodeDefault 2016-05-24
    10:36:38.663 xcodebuild[37889:5262508]<br>
    XCODE_DEFAULT_TOOLCHAIN_OVERRIDE =
    /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain
    CXX(target) Release/obj.target/bufferutil/src/bufferutil.o<br>
    SOLINK_MODULE(target) Release/bufferutil.node ld: warning: URGENT:
    building for OSX, but linking against dylib
    (/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator9.3.sdk/usr/lib/libstdc++.dylib)
    built for iOS. Note: This will be an error in the future. ld: warning:
    URGENT: building for OSX, but linking against dylib
    (/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator9.3.sdk/usr/lib/libSystem.dylib)
    built for iOS. Note: This will be an error in the future.</p>
    
    <blockquote>
      <p>utf-8-validate@1.2.1 install /Users/andreahylton/idpractice/node_modules/utf-8-validate
      node-gyp rebuild</p>
    </blockquote>
    
    <p>2016-05-24 10:36:42.522 xcodebuild[37965:5262650] Build settings from
    command line: 2016-05-24 10:36:42.523 xcodebuild[37965:5262650]<br>
    TOOLCHAINS = com.apple.dt.toolchain.XcodeDefault 2016-05-24
    10:36:42.523 xcodebuild[37965:5262650]<br>
    XCODE_DEFAULT_TOOLCHAIN_OVERRIDE =
    /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain
    CXX(target) Release/obj.target/validation/src/validation.o<br>
    SOLINK_MODULE(target) Release/validation.node ld: warning: URGENT:
    building for OSX, but linking against dylib
    (/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator9.3.sdk/usr/lib/libstdc++.dylib)
    built for iOS. Note: This will be an error in the future. ld: warning:
    URGENT: building for OSX, but linking against dylib
    (/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator9.3.sdk/usr/lib/libSystem.dylib)
    built for iOS. Note: This will be an error in the future.</p>
    
    <blockquote>
      <p>spawn-sync@1.0.15 postinstall /Users/andreahylton/idpractice/node_modules/spawn-sync
      node postinstall</p>
    </blockquote>
  </blockquote>