4

npx react-native init MyApp

√ Downloading template × Copying template error Error: Cannot find module 'C:\Users\%%%%\AppData\Local\Temp\rncli-init-template-rVvcjE\node_modules\react-native\template.config' Require stack: - C:\Users\%%%%%\node_modules\react-native\node_modules@react-native-community\cli\build\commands\init\template.js - C:\Users\%%%%%\node_modules\react-native\node_modules@react-native-community\cli\build\commands\init\init.js - C:\Users\%%%%%\node_modules\react-native\node_modules@react-native-community\cli\build\commands\init\index.js - C:\Users\%%%%%\node_modules\react-native\node_modules@react-native-community\cli\build\commands\index.js - C:\Users\%%%%%\node_modules\react-native\node_modules@react-native-community\cli\build\index.js - C:\Users\%%%%%\node_modules\react-native\cli.js

npx react-native info

info Fetching system and libraries information... System: OS: Windows 10 10.0.18363 CPU: (8) x64 AMD Ryzen 5 2500U with Radeon Vega Mobile Gfx Memory: 3.88 GB / 6.80 GB Binaries: Node: 12.13.1 - C:\Program Files\nodejs\node.EXE npm: 6.12.1 - C:\Program Files\nodejs\npm.CMD SDKs: Android SDK: API Levels: 21, 22, 23, 24, 25, 26, 27, 28, 29 Build Tools: 28.0.3, 29.0.2 IDEs: Android Studio: Version 3.5.0.0 AI-191.8026.42.35.5977832 npmPackages: react-native: 0.61.5 => 0.61.5

To avoid unnecessary responses npm uninstall react-native-cli -g has been already done.

rncli-init-template-rVvcjE from the file path mentioned above does not even exist and I am not sure why. Thanks, everybody for help in advance I am new to stack overflow I have only been programming competitively so far. No stranger to algorithms but for cross-platform development frameworks, I'm a newbie.

1
  • If i have not provided enough information, please do ask :) sorry again, help a newbie out. Commented Dec 9, 2019 at 18:37

2 Answers 2

4

Try to init with yarn. Yarn has a better performance than npm (link July 2019).

Install yarn first

npm install -g yarn

Install react-native-cli. If don't work try with sudo.

yarn global add react-native-cli

Create yout project

react-native init myapp

Related post

Sign up to request clarification or add additional context in comments.

2 Comments

Unfortunately that does not help, neither does anything else i have found online :(
I am seeing the exact same issue. If i do "npm install -g react-native-cli" I am then able to init an app using "npx react-native init MyApp" however i then have later issues in my app and SO answers say you should not have a global version of "react-native-cli"
0
  1. first uninstall your nodejs using nodejs setup(the same version you have installed)
  2. reboot your computer (optional)
  3. after all install again nodejs (nodejs.org/en/download/) and all will be fine.

1 Comment

I get this problem because I was playing with node files (npm to be more specific). 😅

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.