Skip to content
GitLab
Projects Groups Snippets
  • /
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in / Register
  • C create-react-app
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Issues 1,547
    • Issues 1,547
    • List
    • Boards
    • Service Desk
    • Milestones
  • Merge requests 417
    • Merge requests 417
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
  • Deployments
    • Deployments
    • Environments
    • Releases
  • Packages and registries
    • Packages and registries
    • Package Registry
    • Infrastructure Registry
  • Monitor
    • Monitor
    • Incidents
  • Analytics
    • Analytics
    • Value stream
    • CI/CD
    • Repository
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • Meta
  • create-react-app
  • Issues
  • #2655
Closed
Open
Issue created Jun 28, 2017 by Administrator@rootContributor

Ejecting crashes if no devDependencies exists in package.json

Created by: geelen

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!

Assignee
Assign to
Time tracking