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.

Missing script: eject

See original GitHub issue

Description

I have an Expo App (which I have created with Expo, did not recall calling create-react-native-app), which I would like to be able to run both through Expo and with Xcode. So, I duplicated by copy-pasting the Expo App and run npm run eject in the project directory of a duplicate. When I did that, i get the error: missing script: eject

Expected Behavior

I expected being walked through the process of ejecting:

This is usually as simple as running npm run eject in your project, which will walk you through the process.

Observed Behavior

I got the error:

missing script: eject   
A complete log of this run can be found in:
/Users/UserName/.npm/_logs/2017-09-28T15_03_32_533Z-debug.log
0 info it worked if it ends with ok
1 verbose cli [ '/usr/local/Cellar/node/8.6.0/bin/node',
1 verbose cli   '/usr/local/bin/npm',
1 verbose cli   'run',
1 verbose cli   'eject' ]
2 info using npm@5.4.2
3 info using node@v8.6.0
4 verbose stack Error: missing script: eject
4 verbose stack     at run (/usr/local/lib/node_modules/npm/lib/run-script.js:151:19)
4 verbose stack     at /usr/local/lib/node_modules/npm/lib/run-script.js:61:5
4 verbose stack     at /usr/local/lib/node_modules/npm/node_modules/read-package-json/read-json.js:115:5
4 verbose stack     at /usr/local/lib/node_modules/npm/node_modules/read-package-json/read-json.js:402:5
4 verbose stack     at checkBinReferences_ (/usr/local/lib/node_modules/npm/node_modules/read-package-json/read-json.js:357:45)
4 verbose stack     at final (/usr/local/lib/node_modules/npm/node_modules/read-package-json/read-json.js:400:3)
4 verbose stack     at then (/usr/local/lib/node_modules/npm/node_modules/read-package-json/read-json.js:160:5)
4 verbose stack     at /usr/local/lib/node_modules/npm/node_modules/read-package-json/read-json.js:348:12
4 verbose stack     at /usr/local/lib/node_modules/npm/node_modules/graceful-fs/graceful-fs.js:78:16
4 verbose stack     at tryToString (fs.js:514:3)
5 verbose cwd /Users/UserName/workspace/MyApps/app-number-2
6 verbose Darwin 16.5.0
7 verbose argv "/usr/local/Cellar/node/8.6.0/bin/node" "/usr/local/bin/npm" "run" "eject"
8 verbose node v8.6.0
9 verbose npm  v5.4.2
10 error missing script: eject
11 verbose exit [ 1, true ]

Environment

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

  • npm ls react-native-scripts:

app-number-1@0.0.0 /Users/UserName/workspace/MyApps/app-number-2-└── (empty)

  • npm ls react-native: app-number-1@0.0.0 /Users/UserName/workspace/MyApps/app-number-2 └── react-native@0.46.1
  • npm ls expo: app-number-1@0.0.0 /Users/UserName/workspace/MyApps/app-number-2 └── expo@19.0.0
  • node -v: v8.6.0
  • npm -v: 5.4.2
  • yarn --version: -bash: yarn: command not found
  • watchman version: { “version”: “4.9.0” } Also specify:
  1. Operating system: macOS Sierra 10.12.4
  2. Phone/emulator/simulator & version: iPhone6 - iOS 10.3

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
  • Reactions:9
  • Comments:8 (2 by maintainers)

github_iconTop GitHub Comments

2reactions
anpcommented, Feb 26, 2018

@Benzer1406 we’re working on adding this functionality to projects created by Expo tools, but aren’t there quite yet.

2reactions
Benzer1406commented, Feb 26, 2018

Have the same problem. Just created a fresh project with Expo IDE. Just wanted to eject it, to test is for future ejection and implementation of native APIs, but I get the error “missing script: eject”

Read more comments on GitHub >

github_iconTop Results From Across the Web

'npm run eject' error 'missing script: eject' in react
Can you make sure that you are running npm run eject in the same directory as your package.json file? – Daniel Dyrnes. Aug...
Read more >
Problem in Ejecting React Native Project (npm run eject issue ...
Problem – After running “npm start” execution got stuck on “starting/running packager..” Unable To Load Script From Assets index.android.bundle. Leave a Comment ...
Read more >
npm run eject missing script
npm run eject. Committing the changes of the GIT repository: git add . git commit -am "Save before ejecting" If any of the...
Read more >
npm ERR! Missing script: "eject" react native - Code Grepper
npm ERR! Missing script: "eject" react native ; 1. 1. add the below code inside package.json ; 2. "scripts": { ; 3. "start":...
Read more >
[Solved] npm err! missing script: start - ItsJavaScript
How to fix npm err! missing script: start · Solution 1 – Add the Start Scripts in package.json · Solution 2 – Ensure...
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