Javascript 与您的操作系统或架构不兼容:[email protected]

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/36725181/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-08-23 19:29:33  来源:igfitidea点击:

Not compatible with your operating system or architecture: [email protected]

javascriptnode.jsnpmnpm-installfsevents

提问by randomuser

I'm using Ubuntu 15.04. While running the following command:

我正在使用 Ubuntu 15.04。在运行以下命令时:

npm install fsevents

I'm getting following error:

我收到以下错误:

npm WARN optional Skipping failed optional dependency /chokidar/fsevents:
npm WARN notsup Not compatible with your operating system or architecture: [email protected]
npm WARN [email protected] No repository field.

Has anybody solved this?

有没有人解决过这个问题?

回答by Cezar Augusto

I was facing the same issue with this dependecy when building other application.

在构建其他应用程序时,我遇到了与此依赖关系相同的问题。

Just for the sake of knowledge and to people who are not well used to NPM, and thus uncertain about how their applications will behave:

只是为了知识和那些不太习惯 NPM 的人,因此不确定他们的应用程序将如何运行:

Since fseventsis an API in OS X allows applications to register for notifications of changes to a given directory tree. Running:

因为fseventsOS X 中的一个API,允许应用程序注册对给定目录树的更改通知。跑步:

npm install --no-optional

npm install --no-optional

Will do the trick, with no drawbacks.

会做的伎俩,没有缺点。

回答by JMM

It's not an error, it's just a warning: it's an optional dependency.

这不是错误,只是警告:它是一个可选的依赖项。

回答by Simon D

You can tell npm not to install optional dependencies by default using the command line below:

您可以使用以下命令行告诉 npm 默认不安装可选依赖项:

npm config set optional false

回答by csga5000

If you're getting ERR! not WARN a likely cause of this issue is that you're using a really outdated version of NPM

如果您遇到错误!not WARN 此问题的一个可能原因是您使用的是非常过时的 NPM 版本

For me, I shelled into some server, and was like "why won't this work?", getting this error:

对我来说,我进入了一些服务器,就像“为什么这行不通?”,得到这个错误:

npm ERR! Linux 4.4.0-130-generic
npm ERR! argv "/home/william/.nvm/versions/node/v4.4.3/bin/node" "/home/william/.nvm/versions/node/v4.4.3/bin/npm" "install"
npm ERR! node v4.4.3
npm ERR! npm  v2.15.1
npm ERR! code EBADPLATFORM

npm ERR! notsup Unsupported
npm ERR! notsup Not compatible with your operating system or architecture: [email protected]
npm ERR! notsup Valid OS:    darwin
npm ERR! notsup Valid Arch:  any
npm ERR! notsup Actual OS:   linux
npm ERR! notsup Actual Arch: x64

npm ERR! Please include the following file with any support request:
npm ERR!     /home/william/app/mcard-api/npm-debug.log

Turns out this server (that I only recently acquired) was running npm 2.15.1. I re-installed nvm, and nvm install --lts fixed it.

原来这台服务器(我最近才获得的)正在运行 npm 2.15.1。我重新安装了 nvm,然后 nvm install --lts 修复了它。

回答by Supa_dave72

I found if you use "yarn add ." Yarn will exclude the fsevents will not throw an error.

我发现如果您使用“纱线添加”。Yarn 会排除 fsevents 不会抛出错误。

回答by santosh bhoyar

I had same issue with dependency. Kindly check for the package.json file , add "typings":"^0.8.1" entry under devDependency section. dont forget to add comma before :) Hope it will resolve issue.

我有同样的依赖问题。请检查 package.json 文件,在 devDependency 部分下添加 "typings":"^0.8.1" 条目。不要忘记在 :) 之前添加逗号,希望它能解决问题。

回答by fedorqui 'SO stop harming'

I was also facing this error when installing Redux:

安装Redux时我也遇到了这个错误:

$ npm install --save react-redux
npm WARN optional Skipping failed optional dependency /chokidar/fsevents:
npm WARN notsup Not compatible with your operating system or architecture: [email protected]

What solved the issue was to add --no-optional(argument will prevent optional dependencies from being installed):

解决问题的是添加--no-optional参数将阻止安装可选依赖项):

npm install --no-optional --save react-redux
            ^^^^^^^^^^^^^

And now it is correctly installed:

现在它已正确安装:

$ npm ls redux
ReduxProject@ /home/me/projects/reduxproject
└── [email protected]