有什么方法可以避免fsevents警告?

编程入门 行业动态 更新时间:2024-10-24 16:31:39
本文介绍了有什么方法可以避免fsevents警告?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

尝试使用npm等进行反应,我经常收到以下类型的警告:

Trying to get into react, using npm and such, and I often get these types of warnings:

> npm install axios redux react-redux redux-thunk react-router-dom validator redux-form npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@1.2.8 (node_modules\chokidar\node_modules\fsevents): npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@1.2.8: wanted {"os":"darwin","arch":"any"} (current: {"os":"win32","arch":"x64"}) npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@1.2.8 (node_modules\jest-haste-map\node_modules\fsevents): npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@1.2.8: wanted {"os":"darwin","arch":"any"} (current: {"os":"win32","arch":"x64"}) npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@2.0.6 (node_modules\fsevents): npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@2.0.6: wanted {"os":"darwin","arch":"any"} (current: {"os":"win32","arch":"x64"}) + redux-thunk@2.3.0 + validator@10.11.0 + axios@0.18.0 + react-router-dom@5.0.0 + redux@4.0.1 + react-redux@7.0.2 + redux-form@8.2.0 added 30 packages from 100 contributors and audited 878734 packages in 23.247s found 0 vulnerabilities

显然我可以忽略它们,但是我很好奇是否有办法不得到这些警告?以某种方式配置npm?在package.json中添加一些内容?

Apparently I can just ignore them, but I'm just curious if there's a way to not get these warnings? Configure npm somehow? Adding something to package.json? A flag somewhere?

推荐答案

由于操作系统的缘故,这是一个警告。 fsevents在mac os环境中运行,但在Windows中,它作为可选的依赖项起作用,这是所有警告均不是错误之后的原因。 可以使用 github/paulmillr/chokidar 代替fsevents。

It's a warning, due to the operating system. fsevents run on mac os environment but in windows, it works as optional dependencies that are the reason behind your warning after all its not an error. you can use github/paulmillr/chokidar instead of fsevents.

问题与 shrinkwrap或package-lock.json有关,在每次执行软件包管理器后,该问题都会持续存在。

The problem relates to the "shrinkwrap" or package-lock.json which gets persisted after every package manager execution. Subsequent attempts keep failing as this file is referenced instead of package.json.

将这些选项添加到npm install命令中应该会允许软件包再次安装。

Adding these options to the npm install command should allow packages to install again.

--no-optional argument will prevent optional dependencies from being installed. --no-shrinkwrap argument, which will ignore an available package lock or shrinkwrap file and use the package.json instead

-no-package-lock参数将阻止npm从创建package-lock.json文件开始。 完整的命令如下所示:

--no-package-lock argument will prevent npm from creating a package-lock.json file. The complete command looks like this:

npm install --no-optional --no-shrinkwrap --no-package-lock

您可以查看以下答案 npm警告notsup跳过可选功能:fsevents@1.0.14不受支持的平台

更多推荐

有什么方法可以避免fsevents警告?

本文发布于:2023-10-18 10:45:14,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1504003.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:有什么   方法   fsevents

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!