|
24 | 24 | You can find webpack docs at https://webpack.js.org/.
|
25 | 25 | -->
|
26 | 26 |
|
27 |
| - |
28 |
| -### Can you also reproduce the problem with npm 4.x? |
| 27 | +### Did you try recovering your dependencies? |
29 | 28 |
|
30 | 29 | <!--
|
31 |
| - Many errors, especially related to "missing modules", are due to npm bugs. |
32 |
| - Which version of npm are you running? You can find out by checking: |
33 |
| -
|
34 |
| - npm -v |
| 30 | + Your module tree might be corrupted, and that might be causing the issues. |
| 31 | + Let's try to recover it. First, delete these files and folders in your project: |
35 | 32 |
|
36 |
| - If it is 5.x, please be aware that it has more than 50 known bugs, and |
37 |
| - is not guaranteed to work with Create React App. |
| 33 | + * node_modules |
| 34 | + * package-lock.json |
| 35 | + * yarn.lock |
38 | 36 |
|
39 |
| - If it's not starting with 4, try to install npm 4.x: |
| 37 | + Then you need to decide which package manager you prefer to use. |
| 38 | + We support both npm (https://npmjs.com) and yarn (http://yarnpkg.com/). |
| 39 | + However, **they can't be used together in one project** so you need to pick one. |
| 40 | + |
| 41 | + If you decided to use npm, run this in your project directory: |
40 | 42 |
|
41 |
| - npm install -g npm@4 |
42 |
| - cd your_project_directory |
43 |
| - rm -rf node_modules |
44 |
| - npm cache clear |
| 43 | + npm install -g npm@latest |
45 | 44 | npm install
|
46 | 45 |
|
47 |
| - Then try to reproduce the issue again. |
48 |
| - Can you still reproduce it? |
| 46 | + This should fix your project. |
| 47 | + |
| 48 | + If you decided to use yarn, update it first (https://yarnpkg.com/en/docs/install). |
| 49 | + Then run in your project directory: |
| 50 | +
|
| 51 | + yarn |
49 | 52 |
|
50 |
| - Note: Please try this even if you are using Yarn so that we know whether it's a Yarn-only bug. |
| 53 | + This should fix your project. |
| 54 | +
|
| 55 | + Importantly, **if you decided to use yarn, you should never run `npm install` in the project**. |
| 56 | + For example, yarn users should run `yarn add <library>` instead of `npm install <library>`. |
| 57 | + Otherwise your project will break again. |
| 58 | +
|
| 59 | + Have you done all these steps and still see the issue? |
| 60 | + Please paste the output of `npm --version` and/or `yarn --version` to confirm. |
51 | 61 | -->
|
52 | 62 |
|
53 | 63 | (Write your answer here.)
|
54 | 64 |
|
55 |
| - |
56 | 65 | ### Which terms did you search for in User Guide?
|
57 | 66 |
|
58 | 67 | <!--
|
59 | 68 | There are a few common documented problems, such as watcher not detecting changes, or build failing.
|
60 | 69 | They are described in the Troubleshooting section of the User Guide:
|
61 | 70 |
|
62 |
| - https://github.com/facebookincubator/create-react-app/blob/master/packages/react-scripts/template/README.md#troubleshooting |
| 71 | + https://github.com/facebook/create-react-app/blob/master/packages/react-scripts/template/README.md#troubleshooting |
63 | 72 |
|
64 | 73 | Please scan these few sections for common problems.
|
65 | 74 | Additionally, you can search the User Guide itself for something you're having issues with:
|
66 | 75 |
|
67 |
| - https://github.com/facebookincubator/create-react-app/blob/master/packages/react-scripts/template/README.md |
| 76 | + https://github.com/facebook/create-react-app/blob/master/packages/react-scripts/template/README.md |
68 | 77 |
|
69 | 78 | If you didn't find the solution, please share which words you searched for.
|
70 | 79 | This helps us improve documentation for future readers who might encounter the same problem.
|
|
76 | 85 | ### Environment
|
77 | 86 |
|
78 | 87 | <!--
|
79 |
| - Please fill in all the relevant fields by running these commands in terminal. |
80 |
| ---> |
| 88 | + To help identify if a problem is specific to a platform, browser, or module version, information about your environment is required. |
| 89 | + This enables the maintainers quickly reproduce the issue and give feedback. |
81 | 90 |
|
82 |
| -1. `node -v`: |
83 |
| -2. `npm -v`: |
84 |
| -3. `yarn --version` (if you use Yarn): |
85 |
| -4. `npm ls react-scripts` (if you haven’t ejected): |
| 91 | + Run the following command in your React app's folder in terminal. |
| 92 | + Note: The result is copied to your clipboard directly. |
86 | 93 |
|
87 |
| -Then, specify: |
| 94 | + `npx create-react-app --info` |
88 | 95 |
|
89 |
| -1. Operating system: |
90 |
| -2. Browser and version (if relevant): |
| 96 | + Paste the output of the command in the section below. |
| 97 | +--> |
91 | 98 |
|
| 99 | +(paste the output of the command here) |
92 | 100 |
|
93 | 101 | ### Steps to Reproduce
|
94 | 102 |
|
|
0 commit comments