There is a project developed on Mac, and the package npm i is installed, and everything is normal; Put this project on a Linux machine, install the package npm i, and report a bunch of warnings: npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@^1.2.7 (node_modules/chokidar/node_modules/fsevents): npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for [email protected]: wanted {"os":"darwin","arch":"any"} (current: {"os":"linux","arch":"x64"}) npm WARN [email protected] No description npm WARN [email protected] No repository field. npm WARN optional SKIPPING OPTIONAL DEPENDENCY: [email protected] (node_modules/fsevents/node_modules/abbrev): npm WARN enoent SKIPPING OPTIONAL DEPENDENCY: ENOENT: no such file or directory, rename '/root/2019/0403/node_modules/fsevents/node_modules/abbrev' -> '/root/2019/0403/node_modules/fsevents/node_modules/.abbrev.DELETE' npm WARN optional SKIPPING OPTIONAL DEPENDENCY: [email protected] (node_modules/fsevents/node_modules/ansi-regex): npm WARN enoent SKIPPING OPTIONAL DEPENDENCY: ENOENT: no such file or directory, rename '/root/2019/0403/node_modules/fsevents/node_modules/ansi-regex' -> '/root/2019/0403/node_modules/fsevents/node_modules/.ansi-regex.DELETE' npm WARN optional SKIPPING OPTIONAL DEPENDENCY: [email protected] (node_modules/fsevents/node_modules/aproba): npm WARN enoent SKIPPING OPTIONAL DEPENDENCY: ENOENT: no such file or directory, rename '/root/2019/0403/node_modules/fsevents/node_modules/aproba' -> '/root/2019/0403/node_modules/fsevents/node_modules/.aproba.DELETE' npm WARN optional SKIPPING OPTIONAL DEPENDENCY: [email protected] (node_modules/fsevents/node_modules/balanced-match): npm WARN enoent SKIPPING OPTIONAL DEPENDENCY: ENOENT: no such file or directory, rename '/root/2019/0403/node_modules/fsevents/node_modules/balanced-match' -> '/root/2019/0403/node_modules/fsevents/node_modules/.balanced-match.DELETE' npm WARN optional SKIPPING OPTIONAL DEPENDENCY: [email protected] (node_modules/fsevents/node_modules/chownr): npm WARN enoent SKIPPING OPTIONAL DEPENDENCY: ENOENT: no such file or directory, rename '/root/2019/0403/node_modules/fsevents/node_modules/chownr' -> '/root/2019/0403/node_modules/fsevents/node_modules/.chownr.DELETE' npm WARN optional SKIPPING OPTIONAL DEPENDENCY: [email protected] (node_modules/fsevents/node_modules/code-point-at): npm WARN enoent SKIPPING OPTIONAL DEPENDENCY: ENOENT: no such file or directory, rename '/root/2019/0403/node_modules/fsevents/node_modules/code-point-at' -> '/root/2019/0403/node_modules/fsevents/node_modules/.code-point-at.DELETE' ... When executing npm ls, there are many UNMET OPTIONAL DEPENDENCY modules, and a lot of errors are reported at the end: │ ├── [email protected] deduped │ ├── [email protected] deduped │ ├── [email protected] deduped │ └─┬ [email protected] │ └── [email protected] ├─┬ UNMET OPTIONAL DEPENDENCY [email protected] │ ├── [email protected] │ └─┬ UNMET OPTIONAL DEPENDENCY [email protected] │ ├── UNMET OPTIONAL DEPENDENCY [email protected] │ ├─┬ UNMET DEPENDENCY [email protected] │ │ └── UNMET DEPENDENCY [email protected] │ ├─┬ UNMET OPTIONAL DEPENDENCY [email protected] │ │ ├─┬ UNMET OPTIONAL DEPENDENCY [email protected] │ │ │ └── UNMET OPTIONAL DEPENDENCY [email protected] │ │ ├─┬ UNMET OPTIONAL DEPENDENCY [email protected] │ │ │ └── UNMET OPTIONAL DEPENDENCY [email protected] │ │ └── UNMET OPTIONAL DEPENDENCY [email protected] │ ├─┬ UNMET OPTIONAL DEPENDENCY [email protected] │ │ ├── UNMET OPTIONAL DEPENDENCY [email protected] │ │ └─┬ UNMET OPTIONAL DEPENDENCY [email protected] │ │ ├── UNMET OPTIONAL DEPENDENCY [email protected] │ │ └── UNMET OPTIONAL DEPENDENCY [email protected] │ ├─┬ UNMET OPTIONAL DEPENDENCY [email protected] │ │ ├─┬ UNMET OPTIONAL DEPENDENCY [email protected] │ │ │ └─┬ UNMET DEPENDENCY [email protected] │ │ │ └─┬ UNMET DEPENDENCY [email protected] │ │ │ ├── UNMET DEPENDENCY [email protected] │ │ │ └── UNMET DEPENDENCY [email protected] │ │ └── UNMET OPTIONAL DEPENDENCY [email protected] │ ├─┬ UNMET OPTIONAL DEPENDENCY [email protected] │ │ ├─┬ UNMET OPTIONAL DEPENDENCY [email protected] │ │ │ ├── UNMET OPTIONAL DEPENDENCY [email protected] │ │ │ └─┬ UNMET OPTIONAL DEPENDENCY [email protected] │ │ │ ├── UNMET OPTIONAL DEPENDENCY [email protected] │ │ │ ├── UNMET DEPENDENCY [email protected] │ │ │ ├── UNMET OPTIONAL DEPENDENCY [email protected] │ │ │ ├── UNMET OPTIONAL DEPENDENCY [email protected] │ │ │ ├── UNMET DEPENDENCY [email protected] │ │ │ ├─┬ UNMET OPTIONAL DEPENDENCY [email protected] │ │ │ │ └── UNMET DEPENDENCY [email protected] │ │ │ └── UNMET OPTIONAL DEPENDENCY [email protected] │ │ ├── UNMET DEPENDENCY [email protected] │ │ ├─┬ UNMET OPTIONAL DEPENDENCY [email protected] │ │ │ ├── UNMET OPTIONAL DEPENDENCY [email protected] │ │ │ ├── UNMET DEPENDENCY [email protected] │ │ │ ├── UNMET OPTIONAL DEPENDENCY [email protected] │ │ │ ├── UNMET OPTIONAL DEPENDENCY [email protected] │ │ │ ├── UNMET OPTIONAL DEPENDENCY [email protected] │ │ │ ├─┬ UNMET DEPENDENCY [email protected] │ │ │ │ ├── UNMET DEPENDENCY [email protected] │ │ │ │ ├─┬ UNMET DEPENDENCY [email protected] │ │ │ │ │ └── UNMET DEPENDENCY [email protected] │ │ │ │ └── UNMET DEPENDENCY [email protected] │ │ │ ├─┬ UNMET DEPENDENCY [email protected] │ │ │ │ └── UNMET DEPENDENCY [email protected] │ │ │ └─┬ UNMET OPTIONAL DEPENDENCY [email protected] │ │ │ └── UNMET DEPENDENCY [email protected] │ │ └── UNMET OPTIONAL DEPENDENCY [email protected] │ ├─┬ UNMET OPTIONAL DEPENDENCY [email protected] │ │ ├── UNMET OPTIONAL DEPENDENCY [email protected] │ │ ├── UNMET OPTIONAL DEPENDENCY [email protected] │ │ ├── UNMET OPTIONAL DEPENDENCY [email protected] │ │ └── UNMET OPTIONAL DEPENDENCY [email protected] │ ├─┬ UNMET OPTIONAL DEPENDENCY [email protected] │ │ └─┬ UNMET OPTIONAL DEPENDENCY [email protected] │ │ ├── UNMET OPTIONAL DEPENDENCY [email protected] │ │ ├─┬ UNMET OPTIONAL DEPENDENCY [email protected] │ │ │ ├── UNMET DEPENDENCY [email protected] │ │ │ └── UNMET DEPENDENCY [email protected] │ │ ├── UNMET DEPENDENCY [email protected] │ │ ├── UNMET DEPENDENCY [email protected] │ │ ├─┬ UNMET DEPENDENCY [email protected] │ │ │ └── UNMET DEPENDENCY [email protected] │ │ └── UNMET OPTIONAL DEPENDENCY [email protected] │ ├── UNMET OPTIONAL DEPENDENCY [email protected] │ └─┬ UNMET OPTIONAL DEPENDENCY [email protected] │ ├── UNMET OPTIONAL DEPENDENCY [email protected] │ ├─┬ UNMET OPTIONAL DEPENDENCY [email protected] │ │ └── UNMET DEPENDENCY [email protected] │ ├─┬ UNMET DEPENDENCY [email protected] │ │ ├── UNMET DEPENDENCY [email protected] │ │ └── UNMET DEPENDENCY [email protected] │ ├─┬ UNMET OPTIONAL DEPENDENCY [email protected] │ │ └── UNMET DEPENDENCY [email protected] │ ├── UNMET DEPENDENCY [email protected] │ ├── UNMET DEPENDENCY [email protected] │ └── UNMET DEPENDENCY [email protected] ├─┬ [email protected] │ ├─┬ [email protected] │ │ └── [email protected] deduped │ └── [email protected] ├── [email protected] ├─┬ [email protected] │ └── [email protected] ├─┬ [email protected] │ └── [email protected] ├── [email protected] ├── [email protected] ├─┬ [email protected] │ ├── [email protected] │ ├── [email protected] deduped │ └─┬ [email protected] │ ├── [email protected] │ ├── [email protected] deduped │ ├── [email protected] │ ├── [email protected] │ ├── [email protected] │ ├─┬ [email protected] │ │ └── [email protected] deduped │ └── [email protected] └── [email protected] npm ERR! missing: [email protected], required by [email protected] npm ERR! missing: [email protected], required by [email protected] npm ERR! missing: [email protected], required by [email protected] npm ERR! missing: [email protected], required by [email protected] npm ERR! missing: [email protected], required by [email protected] npm ERR! missing: [email protected], required by [email protected] npm ERR! missing: [email protected], required by [email protected] npm ERR! missing: [email protected], required by [email protected] npm ERR! missing: [email protected], required by [email protected] npm ERR! missing: [email protected], required by [email protected] npm ERR! missing: [email protected], required by [email protected] npm ERR! missing: [email protected], required by [email protected] npm ERR! missing: [email protected], required by [email protected] npm ERR! missing: [email protected], required by [email protected] npm ERR! missing: [email protected], required by [email protected] npm ERR! missing: [email protected], required by [email protected] npm ERR! missing: [email protected], required by [email protected] npm ERR! missing: [email protected], required by [email protected] npm ERR! missing: [email protected], required by [email protected] npm ERR! missing: [email protected], required by [email protected] npm ERR! missing: [email protected], required by [email protected] npm ERR! missing: [email protected], required by [email protected] npm ERR! missing: [email protected], required by [email protected] npm ERR! missing: [email protected], required by [email protected] npm ERR! missing: [email protected], required by [email protected] npm ERR! missing: [email protected], required by [email protected] npm ERR! missing: [email protected], required by [email protected] npm ERR! missing: [email protected], required by [email protected] npm ERR! missing: [email protected], required by [email protected] npm ERR! missing: [email protected], required by [email protected] npm ERR! missing: [email protected], required by [email protected] npm ERR! missing: [email protected], required by [email protected] npm ERR! missing: [email protected], required by [email protected] A careful observation revealed that the UNMET OPTIONAL DEPENDENCY modules and npm ERR are the same modules, and are also the ones that report warnings during installation. A closer look reveals that these are all modules that fsevents depends on. fsevents can only be installed under macOS and cannot be installed on Linux systems. The fsevents module will be skipped under Linux, and the modules that fsevents depends on will not be installed. This is actually a bug in npm. npm i reports a Warn, and npm ls reports an Err, which is inconsistent and easy to cause misunderstanding. Currently, this problem will occur no matter which version of npm is used, and npm i --no-optional cannot solve this problem. These errors do not affect the normal operation of the project because Linux does not require fsevents. If you do not want to see npm Err, you can use npm i -f to force the installation. There will be no warning during the installation. After the installation, run npm ls to see: └─┬ [email protected] └── [email protected] Clean, no errors. My project is chokidar, a module that depends on fsevents, and chokidar depends on browser-sync, webpack, etc. The above is the full content of this article. I hope it will be helpful for everyone’s study. I also hope that everyone will support 123WORDPRESS.COM. You may also be interested in:
|
<<: Master-slave synchronous replication configuration of MySQL database under Linux
MySQL SQL statement performance tuning simple exa...
Docker is really cool, especially because it'...
1. Priority of multiple servers For example, if e...
Recently, the client of a project insisted on hav...
Dependence on knowledge Go cross-compilation basi...
If someone asked you whether running EXPLAIN on a...
getElementById cannot get the object There is a s...
MySQL8.0.22 installation and configuration (super...
Copy code The code is as follows: <input type=...
Table of contents Component Design Defining the f...
Table of contents 1. Container service update and...
1. Enter start in the menu bar and click startup ...
Table of contents 1. Reasons for index failure 2....
Enable the service when you need it, and disable ...
Table of contents Join syntax: 1. InnerJOIN: (Inn...