Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ejecting crashes if no devDependencies exists in package.json #2655

Closed
geelen opened this issue Jun 28, 2017 · 1 comment
Closed

Ejecting crashes if no devDependencies exists in package.json #2655

geelen opened this issue Jun 28, 2017 · 1 comment
Milestone

Comments

@geelen
Copy link

geelen commented Jun 28, 2017

Just hit a bug where yarn eject (or npm run eject) fails with the following message:

TypeError: Cannot read property 'react-scripts' of undefined
    at inquirer.prompt.then.answer (node_modules/react-scripts/scripts/eject.js:149:36)
    at <anonymous>

Here's the line in question. I had moved all my devDependencies to dependencies in order for Heroku to run then in a postinstall step (more info here) and so the eject was exploding on this line. To fix, all I needed to do was:

   "version": "0.1.0",
   "private": true,
+  "devDependencies": {},
   "dependencies": {
     "react": "^15.5.4",
     "react-dom": "^15.5.4",
     "react-scripts": "^1.0.7"
   },

Not necessarily something that needs fixing, but if anyone is googling the exact error message above then this issue will hopefully guide them towards the same fix!

@geelen geelen changed the title Ejecting crashes if no devDependencies exists in package.json Ejecting crashes if no devDependencies exists in package.json Jun 28, 2017
@gaearon gaearon added this to the 1.0.8 milestone Jun 28, 2017
@gaearon
Copy link
Contributor

gaearon commented Jun 28, 2017

@lock lock bot locked and limited conversation to collaborators Jan 21, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

2 participants