react-native: [Packager] Packager does not start after upgrading to NPM 3.0 beta

After upgrading to NPM 3.0 beta (https://github.com/npm/npm/releases/tag/v3.0.0), I re-installed the node_modules through npm install in my React Native project. Everything showed up in the file system, but after calling npm start I get the error:

Could not find dependencies.
Ensure dependencies are installed - run 'npm install' from project root.

No matter how often I call npm install and npm start, the error persists. This happens for me with both 0.6.0 and 0.7.0-rc.

About this issue

  • Original URL
  • State: closed
  • Created 9 years ago
  • Comments: 49 (17 by maintainers)

Most upvoted comments

PATH: [Your Project]/node_modules/react-native/package/packager.js SOLUTION: add’…/…’ & delete ‘node_modules’, CODE:if (!fs.existsSync(path.resolve(__dirname, ‘…/…’, ‘’))) { console.log( ‘\n’ + path.resolve(__dirname, ‘…/…’, ‘’) + ‘Could not find dependencies.\n’ + 'Ensure dependencies are installed - ’ + ‘run 'npm install' from project root.\n’ ); process.exit(); }

This happens because the packager is looking for react-native’s dependencies in its own node_modules directory. In npm 3, all dependencies install flat in the top level node_modules.

https://github.com/facebook/react-native/blob/master/packager/packager.js#L18

I’d love to start using npm3 - will look into a PR.