title: Fix "Cannot find module 'libnpx' " on react-native init
body: <p>With a fresh project, after running <code>react-native init {project}</code>,
  during the phase "Installing required Cocoapods dependencies", this error is thrown:</p>
  
  <pre><code>Error: Cannot find module 'libnpx'
      at Function.Module._resolveFilename (internal/modules/cjs/loader.js:649:15)
      at Function.Module._load (internal/modules/cjs/loader.js:575:25)
      at Module.require (internal/modules/cjs/loader.js:705:19)
      at require (internal/modules/cjs/helpers.js:14:16)
      at Object.&lt;anonymous&gt; (/usr/local/lib/node_modules/npm/bin/npx-cli.js:3:13)
      at Module._compile (internal/modules/cjs/loader.js:799:30)
      at Object.Module._extensions..js (internal/modules/cjs/loader.js:810:10)
      at Module.load (internal/modules/cjs/loader.js:666:32)
      at tryModuleLoad (internal/modules/cjs/loader.js:606:12)
      at Function.Module._load (internal/modules/cjs/loader.js:598:3)
  
  (node:27038) UnhandledPromiseRejectionWarning: Error: Failed to install CocoaPods dependencies for iOS project, which is required by this template.
  Please try again manually: "cd ./RNimage/ios &amp;&amp; pod install".
  </code></pre>
  
  <p>Following the suggestion to run <code>pod install</code>, the same error is thrown in addition to </p>
  
  <pre><code>[!] Invalid 'Podfile' file 767: unexpected token at ''. 
   #  from /Users/.../Desktop/Development/RNproject/ios/Podfile:42
   #  -------------------------------------------
   #  
   &gt;    use_native_modules!
   #  end
   #  ------------------------------------------- 
  </code></pre>
  
  <p>I haven't even touched the project why is this happening and how do i fix it?</p>
  
  <p>Before this i ran <code>sudo chown -R 501:20 "/Users/vorousjames/.npm"</code>. I dont know if thats significant to this issue but it has broken alot.</p>