UnhandledPromiseRejectionWarning: Error: Cannot find module 'init.js'
See original GitHub issueDescription
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.0npm -v
: 6.4.1yarn --version
: 1.9.4watchman version
: bash: watchman: command not found
- Operating system: Windows 8.1
- Phone/emulator/simulator & version: Redmi 6a, Android 8.1
Issue Analytics
- State:
- Created 5 years ago
- Reactions:12
- Comments:12
Top 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 >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
@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
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