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.

UnhandledPromiseRejectionWarning: Error: Cannot find module 'init.js'

See original GitHub issue

Description

The command create-react-native-app app-name cannot complete the installation process successfully

Expected Behavior

I expect the installation to complete successfully , a message of β€œHappy hacking” should appear.

Observed Behavior

I’ve tried to completely uninstalling node, but nothing has changed.

$ create-react-native-app plathat
Creating a new React Native app in C:\Users\Bato\Desktop\reactApp\plathat.

Using package manager as yarnpkg with yarn interface.
Installing packages. This might take a couple minutes.
Installing react-native-scripts...

yarn add v1.9.4
info No lockfile found.
[1/4] Resolving packages...
[2/4] Fetching packages...
[3/4] Linking dependencies...
[4/4] Building fresh packages...
success Saved lockfile.
success Saved 20 new dependencies.
info Direct dependencies
└─ react-native-scripts@2.0.1
info All dependencies
β”œβ”€ ansi-styles@3.2.1
β”œβ”€ babel-runtime@6.26.0
β”œβ”€ chalk@2.4.1
β”œβ”€ color-convert@1.9.3
β”œβ”€ color-name@1.1.3
β”œβ”€ core-js@2.5.7
β”œβ”€ cross-spawn@5.1.0
β”œβ”€ escape-string-regexp@1.0.5
β”œβ”€ has-flag@3.0.0
β”œβ”€ isexe@2.0.0
β”œβ”€ lru-cache@4.1.3
β”œβ”€ minimist@1.2.0
β”œβ”€ pseudomap@1.0.2
β”œβ”€ react-native-scripts@2.0.1
β”œβ”€ regenerator-runtime@0.11.1
β”œβ”€ shebang-command@1.2.0
β”œβ”€ shebang-regex@1.0.0
β”œβ”€ supports-color@5.5.0
β”œβ”€ which@1.3.1
└─ yallist@2.1.2
Done in 20.16s.
(node:3528) UnhandledPromiseRejectionWarning: Error: Cannot find module 'C:\Users\Bato\Desktop\reactApp\plathat\node_modules\react-native-scripts\build\scripts\init.js'
    at Function.Module._resolveFilename (module.js:548:15)
    at Function.Module._load (module.js:475:25)
    at Module.require (module.js:597:17)
    at require (internal/module.js:11:18)
    at _callee2$ (C:\Users\Bato\AppData\Roaming\npm\node_modules\create-react-native-app\build\index.js:128:32)
    at tryCatch (C:\Users\Bato\AppData\Roaming\npm\node_modules\create-react-native-app\node_modules\regenerator-runtime\runtime.js:62:40)
    at Generator.invoke [as _invoke] (C:\Users\Bato\AppData\Roaming\npm\node_modules\create-react-native-app\node_modules\regenerator-runtime\runtime.js:296:22)
    at Generator.prototype.(anonymous function) [as next] (C:\Users\Bato\AppData\Roaming\npm\node_modules\create-react-native-app\node_modules\regenerator-runtime\runtime.js:114:21)
    at step (C:\Users\Bato\AppData\Roaming\npm\node_modules\create-react-native-app\node_modules\babel-runtime\helpers\asyncToGenerator.js:17:30)
    at C:\Users\Bato\AppData\Roaming\npm\node_modules\create-react-native-app\node_modules\babel-runtime\helpers\asyncToGenerator.js:28:13
(node:3528) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 1)
(node:3528) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.

Environment

Please run these commands in the project folder and fill in their results:

  • npm ls react-native-scripts: – (empty)
  • npm ls react-native: – (empty)
  • npm ls expo: – (empty)
  • node -v: v8.12.0
  • npm -v: 6.4.1
  • yarn --version: 1.9.4
  • watchman version: bash: watchman: command not found
  1. Operating system: Windows 8.1
  2. Phone/emulator/simulator & version: Redmi 6a, Android 8.1

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Reactions:12
  • Comments:12

github_iconTop GitHub Comments

13reactions
m1771vwcommented, Sep 24, 2018

@EVALIJANI can you explain how to use it with the new expo cli?

Edit: Never mind, looked on the README of create-react-native-app: https://github.com/react-community/create-react-native-app Had to run the following commands: $ npm install -g expo-cli $ expo init my-app $ cd my-app/ $ npm start

7reactions
ghostcommented, Sep 22, 2018

because it is over, shame , you have to use the new create-react-native-app with new expo cli instead of react-native-scripts and it is a mess

Read more comments on GitHub >

github_iconTop Results From Across the Web

Cannot find module 'react-scripts/scripts/init.js' when executed ...
I tried to reinstall node and make sure it was up to date, as well as create-react-app by running npm install -g create-react-app@latest....
Read more >
UnhandledPromiseRejectionWar...
UnhandledPromiseRejectionWarning: Error: Cannot find module 'init.js' #770 ... \react-native-scripts\build\scripts\init.js' at Function.
Read more >
UnhandledPromiseRejectionWar...
[Solved]-UnhandledPromiseRejectionWarning: Error: Cannot find module '/MyProject/node_modules/react-native-scripts/build/scripts/init.js'-Reactjs.
Read more >
cannot find module [Node npm Error Solved] - freeCodeCamp
To fix the error, you need to install the package that is absent in your project directory – npm install package-name or yarn...
Read more >
Fix Global Installs Not Working | "Cannot find module" error FIX
Getting " Cannot find module " after installing something globally (with -g)? Well, this video shows you how to fix global package/moduleΒ ...
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