【问题标题】:unable to yarn install in ubuntu(fsevents@1.2.4: The platform "linux" is incompatible with this module)无法在 ubuntu 中安装纱线(fsevents@1.2.4:平台“linux”与此模块不兼容)
【发布时间】:2019-01-04 07:08:39
【问题描述】:

我从 Github 克隆了一个项目并按照初始说明进行操作,它显示了如下所述的错误。

我试图理解它并用谷歌搜索它,然后我使用nvm 多次更改了我的 NodeJS 版本,但问题没有解决,错误也没有得到修复。

info fsevents@1.2.4: The platform "linux" is incompatible with this 
module.
info "fsevents@1.2.4" is an optional dependency and failed 
compatibility check. Excluding it from installation.
error get-caller-file@2.0.1: The engine "node" is incompatible with 
this module. Expected version "6.* || 8.* || >= 10.*".
error An unexpected error occurred: "Found incompatible module".
info If you think this is a bug, please open a bug report with the 
information provided in "/home/ongraph/Desktop/node/my- 
business/frontend/shared/yarn-error.log".
info Visit https://yarnpkg.com/en/docs/cli/install for documentation 
about this command.
error An unexpected error occurred: "Command failed.
Exit code: 1
Command: sh
Arguments: -c cd frontend/shared && yarn install
Directory: /home/ongraph/Desktop/node/my-business
Output:
".
info If you think this is a bug, please open a bug report with the 
information provided in 
"/home/ongraph/Desktop/node/my-business/yarn-error.log".
info Visit https://yarnpkg.com/en/docs/cli/run for documentation 
about this command.
error An unexpected error occurred: "Command failed.
Exit code: 1
Command: sh
Arguments: -c yarn install && yarn install-backend &&
yarn install-shared && yarn install-web && yarn install-native
Directory: /home/ongraph/Desktop/node/my-business
Output:
".
info If you think this is a bug, please open a bug report with the 
information provided in "/home/ongraph/Desktop/node/my- 
business/yarn-error.log".
info Visit https://yarnpkg.com/en/docs/cli/run for documentation 
about this command.
error An unexpected error occurred: "Command failed.
Exit code: 1
Command: sh
Arguments: -c yarn install-all && yarn knex migrate:latest && yarn 
generate-schema --ignore-engines

截图:

【问题讨论】:

    标签: node.js yarnpkg fsevents


    【解决方案1】:

    您正在寻找错误的东西 :) fsevents 是可选的,您无需担心。而是专注于这一点:

    error get-caller-file@2.0.1: The engine "node" is incompatible with this 
    module. Expected version "6.* || 8.* || >= 10.*". error An unexpected 
    error occurred: "Found incompatible module".
    

    该错误非常具有描述性。请安装正确的节点版本,一切顺利!如果您遇到节点版本冲突的问题(如果您正在处理具有不同要求的多个项目),请转到:https://github.com/creationix/nvm 并安装 nvm 以并行管理多个节点安装。

    【讨论】:

    • Nvm 很棒。让生活更轻松,老实说应该是开发人员设置节点的默认方式。
    • 感谢您的回复,但我已经在使用 nvm 并安装了 8.x、9.x、10.x、11.x 并尝试了每个版本,但错误再次相同
    • 版本更改后,您是否删除了文件夹和锁定文件?此外,如果您在不同的 shell 中,节点版本可能会被 nvm 重置。
    猜你喜欢
    • 2021-03-30
    • 2019-11-26
    • 1970-01-01
    • 2018-11-27
    • 1970-01-01
    • 2021-01-29
    • 2020-09-18
    • 2021-05-11
    • 2022-07-09
    相关资源
    最近更新 更多