Starting App Fails: Getting "sh: react-native-scripts: command not found"
See original GitHub issuePlease 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.0npm ls react-native
: react-native@0.49.5npm ls expo
: expo@22.0.2node -v
: v6.11.5npm -v
: 4.6.1yarn --version
: -bash: yarn: command not found (I removed it for now)watchman version
: “version”: “3.9.0”
Also specify:
- Operating system: Mac OS version 10.12.6
- 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:
- Created 6 years ago
- Comments:5
Top GitHub Comments
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 runyarn install
before runningyarn start
again.In my case I had an old copy of
yarn
which I had installed vianpm
, as well as a good copy installed viahomebrew
. My shell was using the oldyarn
which could not find the scripts. (You can check youryarn
location withwhich yarn
.)The solution was to uninstall the copy of
yarn
that I had installed vianpm
:And then my shell would use the good version of
yarn
instead.