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.

Starting App Fails: Getting "sh: react-native-scripts: command not found"

See original GitHub issue

Please make our job easier by filling this template out to completion. If you’re requesting a feature instead of reporting a bug, please feel free to skip the Environment and Reproducible Demo sections.

Description

I Tried with NPM (I had v5.5.1) and Yarn. After neither worked, I uninstalled yarn, npm, and node, and installed node@v6 and npm@v4. I only rolled back node, after only rolling back npm didn’t work.

After installing create-react-native-app I create a basic app and run “npm start”

Expected Behavior

ran “npm start” Expected it to start the app

Observed Behavior

What actually happened when you performed the above actions?

I got an error and the app didn’t start

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

> CurrencyConverter@0.1.0 start /Users/admin/Data/App Design/2017/React Native Basics: Currency Converter App/CurrencyConverter
> react-native-scripts start

sh: react-native-scripts: command not found
npm ERR! file sh
npm ERR! code ELIFECYCLE
npm ERR! errno ENOENT
npm ERR! syscall spawn
npm ERR! CurrencyConverter@0.1.0 start: `react-native-scripts start`
npm ERR! spawn ENOENT
npm ERR! 
npm ERR! Failed at the CurrencyConverter@0.1.0 start script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR!     /Users/admin/.npm/_logs/2017-11-04T21_24_09_928Z-debug.log

Environment

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

  • npm ls react-native-scripts: react-native-scripts@1.7.0
  • npm ls react-native: react-native@0.49.5
  • npm ls expo: expo@22.0.2
  • node -v: v6.11.5
  • npm -v: 4.6.1
  • yarn --version: -bash: yarn: command not found (I removed it for now)
  • watchman version: “version”: “3.9.0”

Also specify:

  1. Operating system: Mac OS version 10.12.6
  2. Phone/emulator/simulator & version:

Reproducible Demo

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

I’m not sure how to provide a demo for this case.

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:5

github_iconTop GitHub Comments

4reactions
abmirayocommented, Apr 4, 2018

This may happen when you’ve messed with the node_modules folder or dependencies directly. In my case, it was after ejecting and going back to master to an unejected version. Make sure you run yarn install before running yarn start again.

0reactions
joeytwiddlecommented, Jan 8, 2018

In my case I had an old copy of yarn which I had installed via npm, as well as a good copy installed via homebrew. My shell was using the old yarn which could not find the scripts. (You can check your yarn location with which yarn.)

The solution was to uninstall the copy of yarn that I had installed via npm:

npm uninstall -g yarn

And then my shell would use the good version of yarn instead.

Read more comments on GitHub >

github_iconTop Results From Across the Web

react-scripts: command not found - Stack Overflow
I have installed create-react-app and then when I change into the directory and hit npm start I get a react-scripts: command not found...
Read more >
react-scripts: command not found error [Solved] | bobbyhadz
Run the npm install react-scripts command to solve the "react-scripts: command not found" error. If necessary delete your node_modules directory and your ...
Read more >
[Solved] react-scripts: command not found - ItsJavaScript
The react-scripts: command not found error mainly occurs if the dependencies are not installed or if the package-lock.json is corrupted, or if ...
Read more >
How to fix the react-scripts command not found Error - Reactgo
First, delete the node_modules folder in your project (if you have one) using the below command. · Delete the package-lock. · Install the...
Read more >
sh: react-scripts: command not found after running npm start ...
The quick way to fix the react-scripts: command not found error is to delete package-lock.json and node_modules and re-run npm install . However,...
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