question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Cannot find module '@react-native-community/cli'

See original GitHub issue

Environment

Running ‘react-native info’ throws that error as well.

internal/modules/cjs/loader.js:584 throw err; ^

Error: Cannot find module ‘@react-native-community/cli’ at Function.Module._resolveFilename (internal/modules/cjs/loader.js:582:15) at Function.Module._load (internal/modules/cjs/loader.js:508:25) at Module.require (internal/modules/cjs/loader.js:637:17) at require (internal/modules/cjs/helpers.js:22:18) at Object.<anonymous> (E:\Projects\Hady\ProcoorCommunication\node_modules\react-native\cli.js:12:11) at Module._compile (internal/modules/cjs/loader.js:701:30) at Object.Module._extensions…js (internal/modules/cjs/loader.js:712:10) at Module.load (internal/modules/cjs/loader.js:600:32) at tryModuleLoad (internal/modules/cjs/loader.js:539:12) at Function.Module._load (internal/modules/cjs/loader.js:531:3)

Description

Running ‘react-native init AppName’ results in this error (Cannot find module ‘@react-native-community/cli’)

internal/modules/cjs/loader.js:584 throw err; ^

Error: Cannot find module ‘@react-native-community/cli’ at Function.Module._resolveFilename (internal/modules/cjs/loader.js:582:15) at Function.Module._load (internal/modules/cjs/loader.js:508:25) at Module.require (internal/modules/cjs/loader.js:637:17) at require (internal/modules/cjs/helpers.js:22:18) at Object.<anonymous> (E:\Projects\Hady\ProcoorCommunication\node_modules\react-native\cli.js:12:11) at Module._compile (internal/modules/cjs/loader.js:701:30) at Object.Module._extensions…js (internal/modules/cjs/loader.js:712:10) at Module.load (internal/modules/cjs/loader.js:600:32) at tryModuleLoad (internal/modules/cjs/loader.js:539:12) at Function.Module._load (internal/modules/cjs/loader.js:531:3)

Reproducible Demo

Run ‘react-native init AppName’ after it finishes it will try to run cli.js at ‘node_modules\react-native\local-cli\cli.js’ but it fails and throws that error ‘Error: Cannot find module ‘@react-native-community/cli’’

package.json

{
  "name": "ProcoorCommunication",
  "version": "0.0.1",
  "private": true,
  "scripts": {
    "start": "node node_modules/react-native/cli.js start"
  },
  "dependencies": {
    "react-native": "0.59.8"
  }
}

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:16 (3 by maintainers)

github_iconTop GitHub Comments

7reactions
maelpcommented, Feb 13, 2020

For some weird reason it worked with yarn install and then doing the pod install

5reactions
remote-programmer-manishcommented, Feb 14, 2020

installing this solve the issue. npm i @react-native-community/cli

Read more comments on GitHub >

github_iconTop Results From Across the Web

Module not found @react-native-community-cli
If you got error Error: Cannot find module '/node_modules/react-native/local-cli/cli.js' in App Center build, then you need to:.
Read more >
Error: Cannot find module '@react-native-community/cli/ ...
Actual Behavior. But, getting an error while creating a project. react-native-windows@0.61.3 successfully installed. Cannot find module '@react ...
Read more >
react-native-community/cli
Command line tools to interact with React Native projects. This package contains source code for @react-native-community/cli , the actual CLI ...
Read more >
@react-native-community/cli-tools | Yarn - Package Manager
Command line tools that ship with react-native in form of the @react-native-community/cli package. It exposes react-native binary, so you can call yarn ...
Read more >
react-native-community/cli-platform-ios - npm package
We found a way for you to contribute to the project! Looks like @react-native-community/cli-platform-ios is missing a security policy.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found