相关疑难解决方法(0)

如何修复:“错误 fsevents@2.0.7:平台“linux”与此模块不兼容。

我想将我的网站部署到 Heroku,但出现下一个错误:

error fsevents@2.0.7: The platform "linux" is incompatible with this module.
error Found incompatible module.
Run Code Online (Sandbox Code Playgroud)

我已经尝试升级纱线节点但它没有帮助。我使用 macOS Mojave v 10.14.5,我不明白为什么 linux 在这里。



remote: -----> Installing binaries
remote:        engines.node (package.json):  10.15.3
remote:        engines.npm (package.json):   unspecified (use default)
remote:        engines.yarn (package.json):  unspecified (use default)
remote:        
remote:        Resolving node version 10.15.3...
remote:        Downloading and installing node 10.15.3...
remote:        Using default npm version: 6.4.1
remote:        Resolving yarn version 1.x...
remote:        Downloading and installing yarn (1.17.3)...
remote:        Installed yarn 1.17.3
remote:        
remote: -----> Installing …
Run Code Online (Sandbox Code Playgroud)

heroku node.js npm mern yarnpkg

18
推荐指数
2
解决办法
2万
查看次数

React npm start 不起作用:“没有可用的 chokidar 版本”

我从 Github 克隆了我已经在 Github Pages 上运行的 React-Typescript 应用程序,并希望进行一些更改。我运行 npm install 并安装了所有依赖项,但是当我运行 npm start 时,出现此错误;

在此处输入图片说明

我不知道 chokidar 是什么,我看了一点,我认为它与我的项目无关。我仍然尝试 npm install chokidar 并且我遇到了另一个这样的错误;

在此处输入图片说明

也试过npm audit fix了。修复了一些东西,但没有任何改变。

所以我无法打开开发服务器。此外,这是 package.json 文件;

// package.json
{
  "name": "panflix",
  "homepage": "https://absolutezero13.github.io/meerkast/",
  "version": "0.1.0",
  "private": true,
  "dependencies": {
    "@testing-library/jest-dom": "^5.11.4",
    "@testing-library/react": "^11.1.0",
    "@testing-library/user-event": "^12.1.10",
    "@types/enzyme": "^3.10.8",
    "@types/jest": "^26.0.15",
    "@types/node": "^12.0.0",
    "@types/react": "^17.0.0",
    "@types/react-dom": "^17.0.0",
    "@types/redux-devtools": "^3.0.47",
    "axios": "^0.21.1",
    "enzyme": "^3.11.0",
    "firebase": "^8.2.7",
    "gh-pages": "^3.1.0",
    "history": "^4.10.1",
    "react": "^17.0.1",
    "react-bootstrap": "^1.5.0",
    "react-dom": "^17.0.1",
    "react-redux": "^7.2.2",
    "react-router-dom": "^5.2.0", …
Run Code Online (Sandbox Code Playgroud)

npm typescript reactjs chokidar

16
推荐指数
4
解决办法
2万
查看次数

有什么办法可以通过编辑package.json来摆脱npm可选依赖项警告?

我讨厌警告。

尤其是当这些警告完全可忽略时。

我遇到的大多数警告都是不干净的代码警告,我希望代码干净。其他警告是实际错误。

有时我会错过错误警告,因为它们被“隐藏”在其他警告之间。

所以我喜欢保持清洁。

因此,当我这样做npm install并看到以下内容时:

[folatt@MyComputer ~]$ npm install
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@1.2.4 (node_modules/fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@1.2.4: wanted {"os":"darwin","arch":"any"} (current: {"os":"linux","arch":"x64"})

up to date in 33.232s
Run Code Online (Sandbox Code Playgroud)

我想摆脱那个警告。

我知道这个--no-optional论点,但是对我来说似乎也很客气。在package.json中没有什么可以摆脱这种警告的方法吗?

warnings fsevents node.js npm

10
推荐指数
1
解决办法
405
查看次数

Unsupported platform for fsevents@2.3.2 installation issue

我一直在尝试将我的应用程序部署到 vercel 一段时间,并且已经阅读了大量关于 stackoverflow 的帖子,其中存在相同/类似的fsevents问题。尽管如此,我仍然收到下面发布的相同错误。

我尝试过的事情:

  • 卸载node_modules& package-lock.json,然后运行:npm i -f
  • 添加 "optionalDependencies": {"fsevents": "^2.3.2"},然后npm i -f
  • 没有安装fseventspackage.json
  • ...以及许多其他尝试

我的部署中总是发生的事情的屏幕截图

我对整个 fsevents/chokidar 包的内容/原因不是很熟悉,但在我阅读完之后,我的 MacOS 似乎需要它,我真的很感激一些解决这个问题的想法。

在此处输入图片说明

当前包.json

{
  "name": "my-app",
  "version": "0.1.0",
  "private": true,
  "scripts": {
    "dev": "next dev",
    "build": "next build",
    "start": "next start",
    "lint": "eslint .",
    "lint:fix": "eslint --fix ."
  },
  "husky": {
    "hooks": {
      "pre-commit": "lint-staged"
    }
  },
  "lint-staged": {
    "src/**/*.{js,jsx,ts,tsx}": [
      "prettier --write",
      "eslint --fix ."
    ] …
Run Code Online (Sandbox Code Playgroud)

reactjs webpack next.js chokidar next-pwa

8
推荐指数
1
解决办法
4641
查看次数