如何解决 npm install 在非 MAC 操作系统上抛出 fsevents 警告? [英] How to solve npm install throwing fsevents warning on non-MAC OS?

查看:68
本文介绍了如何解决 npm install 在非 MAC 操作系统上抛出 fsevents 警告?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

npm install 命令上抛出以下警告 -

Following warning is being thrown on npm install command -

npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@1.1.2 (node_modules
ea
ct-scripts
ode_modulesfsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@
1.1.2: wanted {"os":"darwin","arch":"any"} (current: {"os":"win32","arch":"x64"}
)
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@^1.0.0 (node_modulesch
okidar
ode_modulesfsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@
1.1.2: wanted {"os":"darwin","arch":"any"} (current: {"os":"win32","arch":"x64"}
)

警告显然导致我们的 Jenkins 作业标记为失败,所以我们只是想摆脱它.

The warning is apparently causing our Jenkins Job to mark failed, so we are just trying to get rid of the same.

我已经检查过这个https://stackoverflow.com/a/42938398/351903但是,与那里提到的不同,我的设置中没有任何/node_modules/fserrors.另外,我的 package.json 不包含 fserrors.以下是我的 package.json -

I already checked this https://stackoverflow.com/a/42938398/351903 But, unlike what is mentioned there, I do not have any /node_modules/fserrors in my setup. Also, my package.json does not contain fserrors. Following is my package.json -

{
  "name": "mvc-panel",
  "version": "0.1.0",
  "private": true,
  "dependencies": {
    "bootstrap": "^3.3.7",
    "jquery": "^3.2.1",
    "material-ui": "^0.18.3",
    "qs": "^6.4.0",
    "react": "^15.5.4",
    "react-alert": "^2.1.2",
    "react-bootstrap-table": "^3.4.1",
    "react-dom": "^15.5.4",
    "react-loader": "^2.4.2",
    "react-router-dom": "^4.1.1",
    "react-tap-event-plugin": "^2.0.1",
    "serve": "^6.0.0"
  },
  "devDependencies": {
    "datatables.net": "^1.10.15",
    "jquery": "^3.2.1",
    "react-scripts": "^1.0.7"
  },
  "scripts": {
    "start": "react-scripts start",
    "build": "react-scripts build",
    "test": "react-scripts test --env=jsdom",
    "eject": "react-scripts eject"
  }
}

我可以在 node_modules eact-scriptspackage.json -

{
  "_args": [
    [
      {
        "raw": "react-scripts@^1.0.7",
        "scope": null,
        "escapedName": "react-scripts",
        "name": "react-scripts",
        "rawSpec": "^1.0.7",
        "spec": ">=1.0.7 <2.0.0",
        "type": "range"
      },
      "D:\Sandeepan\Payu MVC\backend codebase\MVC2.0\panel\mvc-panel"
    ]
  ],
  "_from": "react-scripts@>=1.0.7 <2.0.0",
  "_id": "react-scripts@1.0.14",
  "_inCache": true,
  "_location": "/react-scripts",
  "_nodeVersion": "8.5.0",
  "_npmOperationalInternal": {
    "host": "s3://npm-registry-packages",
    "tmp": "tmp/react-scripts-1.0.14.tgz_1506471610836_0.5613740666303784"
  },
  "_npmUser": {
    "name": "timer",
    "email": "timer150@gmail.com"
  },
  "_npmVersion": "5.3.0",
  "_phantomChildren": {
    "asap": "2.0.6",
    "escape-string-regexp": "1.0.5",
    "graceful-fs": "4.1.11",
    "has-ansi": "2.0.0",
    "universalify": "0.1.1"
  },
  "_requested": {
    "raw": "react-scripts@^1.0.7",
    "scope": null,
    "escapedName": "react-scripts",
    "name": "react-scripts",
    "rawSpec": "^1.0.7",
    "spec": ">=1.0.7 <2.0.0",
    "type": "range"
  },
  "_requiredBy": [
    "#DEV:/"
  ],
  "_resolved": "https://registry.npmjs.org/react-scripts/-/react-scripts-1.0.14.tgz",
  "_shasum": "70fe76c9beb67b136b953e875bdfe4ad78d410d1",
  "_shrinkwrap": null,
  "_spec": "react-scripts@^1.0.7",
  "_where": "D:\Sandeepan\Payu MVC\backend codebase\MVC2.0\panel\mvc-panel",
  "bin": {
    "react-scripts": "./bin/react-scripts.js"
  },
  "bugs": {
    "url": "https://github.com/facebookincubator/create-react-app/issues"
  },
  "dependencies": {
    "autoprefixer": "7.1.2",
    "babel-core": "6.25.0",
    "babel-eslint": "7.2.3",
    "babel-jest": "20.0.3",
    "babel-loader": "7.1.1",
    "babel-preset-react-app": "^3.0.3",
    "babel-runtime": "6.26.0",
    "case-sensitive-paths-webpack-plugin": "2.1.1",
    "chalk": "1.1.3",
    "css-loader": "0.28.4",
    "dotenv": "4.0.0",
    "eslint": "4.4.1",
    "eslint-config-react-app": "^2.0.1",
    "eslint-loader": "1.9.0",
    "eslint-plugin-flowtype": "2.35.0",
    "eslint-plugin-import": "2.7.0",
    "eslint-plugin-jsx-a11y": "5.1.1",
    "eslint-plugin-react": "7.1.0",
    "extract-text-webpack-plugin": "3.0.0",
    "file-loader": "0.11.2",
    "fs-extra": "3.0.1",
    "fsevents": "1.1.2",
    "html-webpack-plugin": "2.29.0",
    "jest": "20.0.4",
    "object-assign": "4.1.1",
    "postcss-flexbugs-fixes": "3.2.0",
    "postcss-loader": "2.0.6",
    "promise": "8.0.1",
    "react-dev-utils": "^4.1.0",
    "style-loader": "0.18.2",
    "sw-precache-webpack-plugin": "0.11.4",
    "url-loader": "0.5.9",
    "webpack": "3.5.1",
    "webpack-dev-server": "2.8.2",
    "webpack-manifest-plugin": "1.2.1",
    "whatwg-fetch": "2.0.3"
  },
  "description": "Configuration and scripts for Create React App.",
  "devDependencies": {
    "react": "^15.5.4",
    "react-dom": "^15.5.4"
  },
  "directories": {},
  "dist": {
    "integrity": "sha512-+p0q2N2WW7L4WW6uObqN7fYwSQZ9fBI0StpMYl1Ukoz/lCbemf+yW6b8refyhTsGy62GAqxlpyEfVcTE3hJAxg==",
    "shasum": "70fe76c9beb67b136b953e875bdfe4ad78d410d1",
    "tarball": "https://registry.npmjs.org/react-scripts/-/react-scripts-1.0.14.tgz"
  },
  "engines": {
    "node": ">=6"
  },
  "files": [
    "bin",
    "config",
    "scripts",
    "template",
    "utils"
  ],
  "homepage": "https://github.com/facebookincubator/create-react-app#readme",
  "license": "MIT",
  "maintainers": [
    {
      "name": "timer",
      "email": "timer150@gmail.com"
    },
    {
      "name": "fb",
      "email": "opensource+npm@fb.com"
    },
    {
      "name": "gaearon",
      "email": "dan.abramov@gmail.com"
    }
  ],
  "name": "react-scripts",
  "optionalDependencies": {
    "fsevents": "1.1.2"
  },
  "readme": "ERROR: No README data found!",
  "repository": {
    "type": "git",
    "url": "git+https://github.com/facebookincubator/create-react-app.git"
  },
  "version": "1.0.14"
}

更新

我尝试运行 npm install 命令并获取先前命令的退出状态.尽管有警告,但它显示 0 表示成功.因此,看起来 Jenkins 的工作不应该因此而被卡住.但是,我们仍在努力寻找消除此警告的方法,因为它与我们的操作系统无关.

I tried running the npm install command and getting the exit status of the earlier command. It showed 0 meaning success, despite the warnings. So, it does not look like Jenkins job should be stuck due to this. However, we are still trying to find a way to get rid of this warning because it is not relevant to our OS.

推荐答案

fsevents 在 mac 和其他 linux 系统中处理不同.Linux 系统忽略 fsevents 而 mac 安装它.由于上面的错误消息指出 fsevents 是可选的,它在安装过程中被跳过.

fsevents is dealt differently in mac and other linux system. Linux system ignores fsevents whereas mac install it. As the above error message states that fsevents is optional and it is skipped in installation process.

你可以在linux系统中运行npm install --no-optional命令来避免上述警告.

You can run npm install --no-optional command in linux system to avoid above warning.

更多信息

https://github.com/npm/npm/issues/14185

https://github.com/npm/npm/issues/5095

这篇关于如何解决 npm install 在非 MAC 操作系统上抛出 fsevents 警告?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆