npm - 如何全局隐藏 fsevents 警告?
问题描述
诸如this one之类的许多问题都在谈论非mac操作系统上这种非常烦人的行为。
当我运行时,npm install
我想随时注意任何警告,但在 Windows 或 Linux 中,我会得到以下信息:
$ ./npm install
npm WARN deprecated chokidar@2.1.8: Chokidar 2 will break on node v14+. Upgrade to chokidar 3 with 15x less dependencies.
npm WARN deprecated fsevents@1.2.13: fsevents 1 will break on node v14+ and could be using insecure binaries. Upgrade to fsevents 2.
npm notice created a lockfile as package-lock.json. You should commit this file.
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@~2.1.2 (node_modules/chokidar/node_modules/fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@2.1.3: wanted {"os":"darwin","arch":"any"} (current: {"os":"linux","arch":"x64"})
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@^1.2.7 (node_modules/watchpack-chokidar2/node_modules/chokidar/node_modules/fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@1.2.13: wanted {"os":"darwin","arch":"any"} (current: {"os":"linux","arch":"x64"})
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@^1.2.7 (node_modules/webpack-dev-server/node_modules/chokidar/node_modules/fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@1.2.13: wanted {"os":"darwin","arch":"any"} (current: {"os":"linux","arch":"x64"})
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@^1.2.7 (node_modules/laravel-mix/node_modules/chokidar/node_modules/fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@1.2.13: wanted {"os":"darwin","arch":"any"} (current: {"os":"linux","arch":"x64"})
npm WARN bootstrap@4.5.0 requires a peer of jquery@1.9.1 - 3 but none is installed. You must install peer dependencies yourself.
added 279 packages from 165 contributors, removed 4 packages, updated 2 packages and audited 1978 packages in 27.632s
请注意,大多数WARN
是由fsevents
macOS 之外不可用的原因引起的。
一些人建议隐藏每个警告:
npm --logevel=error install
其他人建议使用:
npm install --no-optional --no-shrinkwrap --no-package-lock
但所有这些方法对我来说似乎都不合适。我只想执行npm install
并拥有一个配置文件,该文件将隐藏我的操作系统上不可用的所有可选依赖项。
我怎样才能做到这一点?
解决方案
npm install --no-optional
防止此警告。
推荐阅读
- angular - 打印完整的原生元素与直接打印属性之间的差异
- powershell - Powershell 将数据转换为 json 进行解析
- google-chrome - 是否可以在谷歌浏览器中设置特定的 FPS 上限?
- python - selenium python中的下拉选项选择
- entity - Micronaut 3.0.3 中的 GormEntity 问题
- parsing - Haskell 解析,'<*' '*>' 如何解析分隔符之间的内容
- r - 聚合和绘图的缩短代码
- python - 对 Flask API 的 API 调用在 Postman 中有效,在 Flutter 中失败
- aws-serverless - 在 AWS SAM 模板中将 API 事件集成配置为“lambda”而不是默认的“lambda 代理”
- javascript - 动画文本中的绝对位置弄乱了布局