Repository: create-react-app
Issue: react-scripts use wrong directory
Labels: needs triage,issue: bug report



### Describe the bug

I'm trying to install this application created with create-react-app inside another Node project:

https://github.com/themesberg/volt-react-dashboard

when installing the dependencies with yarn. I got this error when running `yarn start`:

```
kuba@jcubic:[~/projects/jcubic/quizerach/admin] (master)$ yarn start
yarn run v1.22.19
$ react-scripts start

There might be a problem with the project dependency tree.
It is likely not a bug in Create React App, but something you need to fix locally.

The react-scripts package provided by Create React App requires a dependency:

  "eslint": "^6.6.0"

Don't try to install it manually: your package manager does it automatically.
However, a different version of eslint was detected higher up in the tree:

  /home/kuba/projects/jcubic/koduj/akademia/quiz/node_modules/eslint (version: 8.35.0)
```

`projects/jcubic/quizerach` is symlink to `/home/kuba/projects/jcubic/koduj/akademia/quiz`

### 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 (https://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.
-->

(Write your answer here.)

### Which terms did you search for in User Guide?

<!--
  There are a few common documented problems, such as watcher not detecting changes, or build failing.
  They are described in the Troubleshooting section of the User Guide:

  https://facebook.github.io/create-react-app/docs/troubleshooting

  Please scan these few sections for common problems.
  Additionally, you can search the User Guide itself for something you're having issues with:

  https://facebook.github.io/create-react-app/

  If you didn't find the solution, please share which words you searched for.
  This helps us improve documentation for future readers who might encounter the same problem.
-->

(Write your answer here if relevant.)

### 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.
-->

(paste the output of the command here.)

### 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 NPM project (you can sue yarn) install ESLint
2. Clone CRA application (like this one https://github.com/themesberg/volt-react-dashboard) into directory inside you app
3. Run `yarn && yarn start` from that new directory

### Expected behavior

The start of the application

### Actual behavior

Error from React-scripts

![react-app](https://user-images.githubusercontent.com/280241/222906239-b144eadf-e2e9-4347-980e-e4caed1e8406.png)

### Reproducible demo

```bash
git clone https://github.com/jcubic/cra-bug.git
cd cra-bug
yarn
cd volt-react-dashboard
yarn
yarn start
```