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
Target Display one of the data in the iostat comm...
First execute the command: [root@mini61 setuptool...
Application scenario: It is necessary to count th...
Table of contents 1. Overview 2. Define a simple ...
Menu bar example 1: Copy code The code is as foll...
1. First register your own dockerhub account, reg...
Table of contents Asynchronous traversal Asynchro...
Preface: In MySQL, views are probably one of the ...
0x00 Introduction WordPress is the most popular C...
1. Time difference functions (TIMESTAMPDIFF, DATE...
The solutions to the problems encountered during x...
How to center an element in the browser window He...
Preface Let me share with you how I deployed a Sp...
This article records the detailed process of down...
This article shares the specific code of JavaScri...