|
| 1 | +# Ignoring optional dependencies |
| 2 | + |
| 3 | +When running `npm install`, you can get warnings about optionsl dependencies: |
| 4 | + |
| 5 | +``` |
| 6 | +npm WARN optional Skipping failed optional dependency /chokidar/fsevents: |
| 7 | +npm WARN notsup Not compatible with your operating system or architecture: [email protected] |
| 8 | +``` |
| 9 | + |
| 10 | +You can suppress them by adding the `no-optional` switch: |
| 11 | + |
| 12 | +``` |
| 13 | +npm install --no-optional |
| 14 | +``` |
| 15 | + |
| 16 | +Further reading: [Stack Overflow](https://stackoverflow.com/questions/36725181/not-compatible-with-your-operating-system-or-architecture-fsevents1-0-11) |
| 17 | + |
| 18 | +# Resolving dependencies |
| 19 | + |
| 20 | +When installing for the first time, you can get warnings which need to be resolved: |
| 21 | + |
| 22 | +``` |
| 23 | +npm WARN [email protected] requires a peer of babel-eslint@^8.0.1 but none was installed. |
| 24 | +npm WARN [email protected] requires a peer of eslint@^4.0 but none was installed. |
| 25 | +npm WARN [email protected] requires a peer of react-intl-redux@^0.7 but none was installed. |
| 26 | +npm WARN [email protected] requires a peer of react-responsive@^4 but none was installed. |
| 27 | +``` |
| 28 | + |
| 29 | +You can check which versions are available: |
| 30 | + |
| 31 | +``` |
| 32 | +npm view react-intl-redux@0.* version |
| 33 | +``` |
| 34 | + |
| 35 | +You will neet do install the required version: |
| 36 | + |
| 37 | +``` |
| 38 | +npm install --no-optional --save-dev react-intl-redux@^0.7 |
| 39 | +``` |
| 40 | + |
| 41 | +The dependency itself might have more missing dependencies, which will show up like this: |
| 42 | + |
| 43 | +``` |
| 44 | +user@machine:~/sources/scratch/scratch-gui (491-translatable-library-objects)$ npm install --no-optional --save-dev react-intl-redux@^0.7 |
| 45 | +[email protected] /media/cuideigin/Linux/sources/scratch/scratch-gui |
| 46 | + |
| 47 | +└── UNMET PEER DEPENDENCY [email protected] |
| 48 | +``` |
| 49 | + |
| 50 | +You will need to install those as well: |
| 51 | + |
| 52 | +``` |
| 53 | +npm install --no-optional --save-dev react-responsive@^5.0.0 |
| 54 | +``` |
| 55 | + |
| 56 | +Further reading: [Stack Overflow](https://stackoverflow.com/questions/46602286/npm-requires-a-peer-of-but-all-peers-are-in-package-json-and-node-modules) |
0 commit comments