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.

create-react-native-app fails to create project on Ubuntu with yarn

See original GitHub issue

Description

I’m having errors trying to initialize a react-native app with this package.

Expected Behavior

If I run create-react-native-app Sauce , it should generate all the files needed for the app.

Observed Behavior

It throws an error while getting the files, then generates only a package.json file

What actually happened when you performed the above actions? It didn’t work.

If there’s an error message, please paste the full terminal output and error message in this code block:

create-react-native-app saucecodemobile
Creating a new React Native app in /home/leksyib/Desktop/saucecodemobile.

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

yarn add v1.3.2
info No lockfile found.
[1/4] Resolving packages...
warning react-native-scripts > xdl > auth0-js > xtend > object-keys@0.4.0: 
[2/4] Fetching packages...
[#####################################################################] 438/439^(node:4524) UnhandledPromiseRejectionWarning: Error: ENOENT: no such file or directory, open '/home/leksyib/Desktop/saucecodemobile/node_modules/react-native-scripts/package.json'
(node:4524) 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:4524) [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

OS: Ubuntu. Node: v9.3.0 Creact-react-native-app: latest.

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

  • npm ls react-native-scripts: `-- (empty)
  • npm ls react-native: – react-native@0.49.3
  • npm ls expo: `-- (empty)
  • node -v: 9.3.0
  • npm -v: 5.6.0
  • yarn --version: 1.3.2
  • watchman version: watchman: command not found

Also specify:

  1. Operating system: Ubuntu

  2. Phone/emulator/simulator & version: Infinix Note 3, nougat.

Reproducible Demo

Please provide a minimized reproducible demonstration of the problem you’re reporting.

Issues that come with minimal repro’s are resolved much more quickly than issues where a maintainer has to reproduce themselves.

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:12 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
cooxcommented, Jan 25, 2018

I just tried create-react-native-app for the first time today, and experienced the same behavior/error on macOS High Sierra + Node 9.3.0 (installed with nvm) 🤔

Looks like something was going wrong during the “Fetching packages” phase of the initial yarn add. The progress bar was stuck at 441/442 for a while (almost like 438/439 for @leksyib), then the same unhandled ENOENT error stopped the process.

Weirdly enough, after a little frustration and a few retries, the process went through to the yarn install part, and finally succeeded up to the “Happy hacking!” message.

I am almost sure that the auth0-js dependency is not the culprit. It just happens to be a module that shows a warning just before the real error happens.

I do believe, though, that the error has to do with some sort of unhandled network fetch timeout, my current Internet connection being particularly bad, and the process finally going through after a few tries. It could be helpful it this was better handled by either create-react-native-app or yarn.

Hope this helps.

0reactions
hellosmithycommented, Apr 5, 2018

Same problems here as others have decribed

node LTS 8.11.1 (via n) macOS High Sierra create-react-native-app version: 1.0.0 yarn version: 1.5.1

[2/4] 🚚  Fetching packages...
verbose 12.531 Performing "GET" request to "https://registry.yarnpkg.com/@expo/ngrok-bin-linux-arm/-/ngrok-bin-linux-arm-2.2.8.tgz".
verbose 12.54 Performing "GET" request to "https://registry.yarnpkg.com/@expo/ngrok-bin-darwin-ia32/-/ngrok-bin-darwin-ia32-2.2.8.tgz".
verbose 12.542 Performing "GET" request to "https://registry.yarnpkg.com/@expo/ngrok-bin-linux-ia32/-/ngrok-bin-linux-ia32-2.2.8.tgz".
verbose 12.544 Performing "GET" request to "https://registry.yarnpkg.com/@expo/ngrok-bin-freebsd-ia32/-/ngrok-bin-freebsd-ia32-2.2.8.tgz".
verbose 12.549 Performing "GET" request to "https://registry.yarnpkg.com/@expo/ngrok-bin-sunos-x64/-/ngrok-bin-sunos-x64-2.2.8.tgz".
verbose 12.553 Performing "GET" request to "https://registry.yarnpkg.com/@expo/ngrok-bin-win32-ia32/-/ngrok-bin-win32-ia32-2.2.8-beta.1.tgz".
verbose 12.555 Performing "GET" request to "https://registry.yarnpkg.com/@expo/ngrok-bin-win32-x64/-/ngrok-bin-win32-x64-2.2.8-beta.1.tgz".
[################################################################################################################################################################################################---] 440/4 ^ [##################################################################################################################################################################################################-] 444/447(node:37666) UnhandledPromiseRejectionWarning: Error: ENOENT: no such file or directory, open '/Users/hellosmithy/Sites/react-native-demo/node_modules/react-native-scripts/package.json'
(node:37666) 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:37666) [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.
Read more comments on GitHub >

github_iconTop Results From Across the Web

create-react-native-app fails to create project on Ubuntu with ...
create-react-native-app fails to create project on Ubuntu with yarn #535 ... Using package manager as yarnpkg with yarn interface.
Read more >
How do I create a React Native project using Yarn?
1. Install yarn. Via NPM. According to its installation docs, you shouldn't install yarn via npm , but if necessary, you can still...
Read more >
react-native | Yarn - Package Manager
Component-Based. Build encapsulated components that manage their state, then compose them to make complex UIs. Developer Velocity. See local changes in seconds.
Read more >
Upgrading to new versions - React Native
Upgrading your Expo project to a new version of React Native requires updating the react-native , react , and expo package versions in...
Read more >
How to Install Yarn on Ubuntu {With Screenshots} - phoenixNAP
Install Yarn on Ubuntu by following this simple step-by-step tutorial. ... To create a new project, go to the project directory and enter:...
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