|
6 | 6 |
|
7 | 7 | (write your answer here)
|
8 | 8 |
|
| 9 | + |
9 | 10 | <!--
|
10 | 11 | If you answered "Yes":
|
11 |
| - |
| 12 | +
|
12 | 13 | Please note that your issue will be fixed much faster if you spend about
|
13 | 14 | half an hour preparing it, including the exact reproduction steps and a demo.
|
14 |
| - |
| 15 | +
|
15 | 16 | If you're in a hurry or don't feel confident, it's fine to report bugs with
|
16 | 17 | less details, but this makes it less likely they'll get fixed soon.
|
17 | 18 |
|
|
24 | 25 | You can find webpack docs at https://webpack.js.org/.
|
25 | 26 | -->
|
26 | 27 |
|
27 |
| - |
28 |
| -### Can you also reproduce the problem with npm 4.x? |
| 28 | +### Did you try recovering your dependencies? |
29 | 29 |
|
30 | 30 | <!--
|
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: |
| 31 | + Your module tree might be corrupted, and that might be causing the issues. |
| 32 | + Let's try to recover it. First, delete these files and folders in your project: |
33 | 33 |
|
34 |
| - npm -v |
| 34 | + * node_modules |
| 35 | + * package-lock.json |
| 36 | + * yarn.lock |
35 | 37 |
|
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. |
| 38 | + Then you need to decide which package manager you prefer to use. |
| 39 | + We support both npm (https://npmjs.com) and yarn (http://yarnpkg.com/). |
| 40 | + However, **they can't be used together in one project** so you need to pick one. |
38 | 41 |
|
39 |
| - If it's not starting with 4, try to install npm 4.x: |
| 42 | + If you decided to use npm, run this in your project directory: |
40 | 43 |
|
41 |
| - npm install -g npm@4 |
42 |
| - cd your_project_directory |
43 |
| - rm -rf node_modules |
44 |
| - npm cache clear |
| 44 | + npm install -g npm@latest |
45 | 45 | npm install
|
46 | 46 |
|
47 |
| - Then try to reproduce the issue again. |
48 |
| - Can you still reproduce it? |
| 47 | + This should fix your project. |
| 48 | +
|
| 49 | + If you decided to use yarn, update it first (https://yarnpkg.com/en/docs/install). |
| 50 | + Then run in your project directory: |
| 51 | +
|
| 52 | + yarn |
| 53 | +
|
| 54 | + This should fix your project. |
| 55 | +
|
| 56 | + Importantly, **if you decided to use yarn, you should never run `npm install` in the project**. |
| 57 | + For example, yarn users should run `yarn add <library>` instead of `npm install <library>`. |
| 58 | + Otherwise your project will break again. |
49 | 59 |
|
50 |
| - Note: Please try this even if you are using Yarn so that we know whether it's a Yarn-only bug. |
| 60 | + Have you done all these steps and still see the issue? |
| 61 | + Please paste the output of `npm --version` and/or `yarn --version` to confirm. |
51 | 62 | -->
|
52 | 63 |
|
53 | 64 | (Write your answer here.)
|
|
59 | 70 | There are a few common documented problems, such as watcher not detecting changes, or build failing.
|
60 | 71 | They are described in the Troubleshooting section of the User Guide:
|
61 | 72 |
|
62 |
| - https://github.com/facebookincubator/create-react-app/blob/master/packages/react-scripts/template/README.md#troubleshooting |
| 73 | + https://facebook.github.io/create-react-app/docs/troubleshooting |
63 | 74 |
|
64 | 75 | Please scan these few sections for common problems.
|
65 | 76 | Additionally, you can search the User Guide itself for something you're having issues with:
|
66 |
| - |
67 |
| - https://github.com/facebookincubator/create-react-app/blob/master/packages/react-scripts/template/README.md |
68 |
| - |
| 77 | +
|
| 78 | + https://facebook.github.io/create-react-app/ |
| 79 | +
|
69 | 80 | If you didn't find the solution, please share which words you searched for.
|
70 | 81 | This helps us improve documentation for future readers who might encounter the same problem.
|
71 | 82 | -->
|
|
76 | 87 | ### Environment
|
77 | 88 |
|
78 | 89 | <!--
|
79 |
| - Please fill in all the relevant fields by running these commands in terminal. |
80 |
| ---> |
| 90 | + To help identify if a problem is specific to a platform, browser, or module version, information about your environment is required. |
| 91 | + This enables the maintainers quickly reproduce the issue and give feedback. |
| 92 | +
|
| 93 | + Run the following command in your React app's folder in terminal. |
| 94 | + Note: The result is copied to your clipboard directly. |
81 | 95 |
|
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): |
| 96 | + `npx create-react-app --info` |
86 | 97 |
|
87 |
| -Then, specify: |
| 98 | + Paste the output of the command in the section below. |
| 99 | +--> |
88 | 100 |
|
89 |
| -1. Operating system: |
90 |
| -2. Browser and version (if relevant): |
| 101 | +(paste the output of the command here) |
91 | 102 |
|
92 | 103 |
|
93 | 104 | ### Steps to Reproduce
|
@@ -146,13 +157,14 @@ Then, specify:
|
146 | 157 |
|
147 | 158 | (Paste the link to an example project and exact instructions to reproduce the issue.)
|
148 | 159 |
|
| 160 | + |
149 | 161 | <!--
|
150 | 162 | What happens if you skip this step?
|
151 |
| - |
| 163 | +
|
152 | 164 | We will try to help you, but in many cases it is impossible because crucial
|
153 | 165 | information is missing. In that case we'll tag an issue as having a low priority,
|
154 | 166 | and eventually close it if there is no clear direction.
|
155 |
| - |
| 167 | +
|
156 | 168 | We still appreciate the report though, as eventually somebody else might
|
157 | 169 | create a reproducible example for it.
|
158 | 170 |
|
|
0 commit comments