|
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 |
| 52 | +
|
| 53 | + This should fix your project. |
49 | 54 |
|
50 |
| - Note: Please try this even if you are using Yarn so that we know whether it's a Yarn-only bug. |
| 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 | <!--
|
|
0 commit comments