Skip to content

Ejecting when scripts folder already exists causes eject to fail permanently #939

Closed

Description

@heldinz

We ran npm run eject and answered y at the prompt. It logged Ejecting... and then stopped with no further output. No config or scripts were copied over, just the new folders config/jest.

We realised that the problem might be that we already had a folder called scripts. We renamed this folder and re-ran the eject command, but got the same result.

I'm fairly certain that the error occurs when the eject script tries to create the scripts folder but it could just as easily have occurred when creating the config or config/jest folders, had we already had existing folders with those names in our project. Although the script checks for the presence of files existing at the path it will copy them to, it does not check for the presence of the folders before creating those.

The eject script should either fail early with the error that the folder already exists (as it does with the files), or it should check for the presence of the folder before attempting to create it. Instead, it fails silently.

Activity

  1. gaearon commented on Oct 21, 2016

    @gaearon
    Contributor

    It should definitely fail early in such cases. I think this used to work but we might have broken it at some point. Would you mind looking into fixing this?

  2. heldinz commented on Oct 21, 2016

    @heldinz
    ContributorAuthor

    Sure!

  3. added a commit that references this issue on Oct 24, 2016
    996fd33
  4. added a commit that references this issue on Oct 28, 2016
    7ce4b6e
  5. added a commit that references this issue on Nov 4, 2016
    d444609
  6. added a commit that references this issue on Nov 18, 2016
    7747830
  7. added a commit that references this issue on Nov 28, 2016
    2572c2a
  8. added a commit that references this issue on Jan 23, 2017
    0c0d144
  9. added a commit that references this issue on May 8, 2017
    72928de
  10. added a commit that references this issue on Mar 7, 2018
    9e4a35f
  11. locked and limited conversation to collaborators on Jan 22, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions