[英]npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents
I'm trying to run this project .我正在尝试运行这个项目。 After updating
minimatch
version to 3.10.9, I'm getting the following error:将
minimatch
版本更新到 3.10.9 后,出现以下错误:
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@^1.0.0 (node_modules\webpack\node_modules\watchpack\node_modules\chokidar\node_modules\fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@1.0.14: wanted {"os":"darwin","arch":"any"} (current: {"os":"win32","arch":"ia32"})
My configuration:我的配置:
Node v - 4.4.2
npm v - 3.10.9
32 bit windows OS
It's a warning, not an error.这是一个警告,而不是错误。 It occurs because
fsevents
is an optional dependency, used only when project is run on macOS environment (the package provides 'Native Access to Mac OS-X FSEvents').它发生是因为
fsevents
是一个可选依赖项,仅在项目在 macOS 环境上运行时使用(该包提供“对 Mac OS-X FSEvents 的本机访问”)。
And since you're running your project on Windows, fsevents
is skipped as irrelevant.由于您在 Windows 上运行项目,
fsevents
被忽略为无关紧要。
There is a PR to fix this behaviour here: https://github.com/npm/cli/pull/169这里有一个 PR 来解决这个问题: https ://github.com/npm/cli/pull/169
This still appears to be an issue, causing package installations to be aborted with warnings about optional packages not being installed because of "Unsupported platform".这似乎仍然是一个问题,导致软件包安装被中止,并警告说由于“不受支持的平台”而未安装可选软件包。
The problem relates to the "shrinkwrap" or package-lock.json
which gets persisted after every package manager execution.问题与“shrinkwrap”或
package-lock.json
,它在每次包管理器执行后都会持续存在。 Subsequent attempts keep failing as this file is referenced instead of package.json
.由于引用了此文件而不是
package.json
,因此后续尝试继续失败。
Adding these options to the npm install
command should allow packages to install again.将这些选项添加到
npm install
命令应该允许包再次安装。
--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 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
nJoy!开心!
使用参数--force:
npm i -f
这已被注册为NPM问题: https : //github.com/npm/npm/issues/14042
This answer worked for me, add this to your package.json
这个答案对我有用,将它添加到你的
package.json
"optionalDependencies": {
"fsevents": "^2.3.2"
}
I`m trying to run this project https://github.com/Soundnode/soundnode-app after updating my minimatch version to 3.10.9, im getting this error我将minimatch版本更新为3.10.9后,尝试运行此项目https://github.com/Soundnode/soundnode-app ,我收到此错误
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@^1.0.0 (node_modules\\webpack\\node_modules\\watchpack\\node_modules\\chokidar\\node_modules\\fsevents): npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@1.0.14: wanted {"os":"darwin","arch":"any"} (current: {"os":"win32","arch":"ia32"})
npm警告可选跳过功能:fsevents@^1.0.0(node_modules \\ webpack \\ node_modules \\ watchpack \\ node_modules \\ chokidar \\ node_modules \\ fsevents):npm WAN notsup跳过可选功能:{{@1.0的不受支持的平台:想要的{:“。 os“:” darwin“,” arch“:” any“}(当前:{” os“:” win32“,” arch“:” ia32“})
my configuration is Node v - 4.4.2 npm v- 3.10.9 im working on 32 bit windows OS我的配置是Node v-4.4.2 npm v- 3.10.9 im在32位Windows OS上工作
Unsupported platform for fsevents
fsevents 不受支持的平台
The current best solution is upgrading your version of npm , which won't have this warning.当前最好的解决方案是升级你的 npm 版本,它不会有这个警告。
If using a Windows machine, an easy way to upgrade is with the tool Upgrade npm on Windows .如果使用 Windows 机器,一种简单的升级方法是使用工具Upgrade npm on Windows 。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.