Repository: create-react-app
Issue: npx create-react-app throws error when using in monorepo
Labels: tag: new feature,issue: needs investigation

<!--
  PLEASE READ THE FIRST SECTION :-)
-->

### Is this a bug report?

Maybe.
I know monorepos are not fully supported, however i would expect this to work.

<!--
  If you answered "Yes":
  
    Please note that your issue will be fixed much faster if you spend about
    half an hour preparing it, including the exact reproduction steps and a demo.
    
    If you're in a hurry or don't feel confident, it's fine to report bugs with
    less details, but this makes it less likely they'll get fixed soon.

    In either case, please fill as many fields below as you can.

  If you answered "No":

    If this is a question or a discussion, you may delete this template and write in a free form.
    Note that we don't provide help for webpack questions after ejecting.
    You can find webpack docs at https://webpack.js.org/.
-->

### Did you try recovering your dependencies?

<!--
  Your module tree might be corrupted, and that might be causing the issues.
  Let's try to recover it. First, delete these files and folders in your project:

    * node_modules
    * package-lock.json
    * yarn.lock

  Then you need to decide which package manager you prefer to use.
  We support both npm (https://npmjs.com) and yarn (http://yarnpkg.com/).
  However, **they can't be used together in one project** so you need to pick one.
  
  If you decided to use npm, run this in your project directory:

    npm install -g npm@latest
    npm install

  This should fix your project.
  
  If you decided to use yarn, update it first (https://yarnpkg.com/en/docs/install).
  Then run in your project directory:

    yarn

  This should fix your project.

  Importantly, **if you decided to use yarn, you should never run `npm install` in the project**.
  For example, yarn users should run `yarn add <library>` instead of `npm install <library>`.
  Otherwise your project will break again.

  Have you done all these steps and still see the issue?
  Please paste the output of `npm --version` and/or `yarn --version` to confirm.
-->

Yes

### Environment

<!--
  To help identify if a problem is specific to a platform, browser, or module version, information about your environment is required.
  This enables the maintainers quickly reproduce the issue and give feedback.

  Run the following command in your React app's folder in terminal.
  Note: The result is copied to your clipboard directly.

  `npx create-react-app --info`

  Paste the output of the command in the section below.
-->
Node v8.11.3
yarn 1.10.1
npx 6.4.1

### Steps to Reproduce

<!--
  How would you describe your issue to someone who doesn’t know you or your project?
  Try to write a sequence of steps that anybody can repeat to see the issue.
-->

(Write your steps here:)

1. Create a lerna / yarn workspaces repo
2. naviagte to packages folder
3. run `create-react-app@next --scripts-version=@next cra-app`


### Expected Behavior

<!--
  How did you expect the tool to behave?
  It’s fine if you’re not sure your understanding is correct.
  Just write down what you thought would happen.
-->

It should create a new create react app.


### Actual Behavior

<!--
  Did something go wrong?
  Is something broken, or not behaving as you expected?
  Please attach screenshots if possible! They are extremely helpful for diagnosing issues.
-->
When running `create-react-app@next --scripts-version=@next cra-app`, I am getting the following error: 
```Unexpected error. Please report it as a bug:
{ Error: Cannot find module '/Users/felixkuehl/cra-monorepo/packages/cra-app/node_modules/react-scripts/package.json'
    at Function.Module._resolveFilename (module.js:547:15)
    at Function.Module._load (module.js:474:25)
    at Module.require (module.js:596:17)
    at require (internal/module.js:11:18)
    at checkNodeVersion (/Users/felixkuehl/.npm/_npx/66044/lib/node_modules/create-react-app/createReactApp.js:543:23)
    at getPackageName.then.then.then.packageName (/Users/felixkuehl/.npm/_npx/66044/lib/node_modules/create-react-app/createReactApp.js:344:7)
    at <anonymous>
    at process._tickCallback (internal/process/next_tick.js:188:7) code: 'MODULE_NOT_FOUND' }
```
This could maybe due to yarn workspaces package hoisting.

Workaround is to just run `create-react-app@next --scripts-version=@next cra-app` outside the monorepo, then delete the node_modules folder and copy the new app into the monorepo.
Anyways, keep up the great work! ;)