【问题标题】:yarn - installation of deasync fails纱线 - 异步安装失败
【发布时间】:2021-10-22 21:47:04
【问题描述】:

当我在 Windows 上使用节点 15 创建一个 react 应用程序时:

yarn create react-app my-project --template typescript

失败了

yarn create v1.22.11
[1/4] Resolving packages...
[2/4] Fetching packages...
info fsevents@1.2.9: The platform "win32" is incompatible with this module.
info "fsevents@1.2.9" is an optional dependency and failed compatibility check. Excluding it from installation.
info fsevents@2.0.6: The platform "win32" is incompatible with this module.
info "fsevents@2.0.6" is an optional dependency and failed compatibility check. Excluding it from installation.
[3/4] Linking dependencies...
[4/4] Building fresh packages...
[-/4] ⠁ waiting...
[-/4] ⠁ waiting...
[3/4] ⠂ deasync
error C:\Users\teyc\AppData\Local\Yarn\Data\global\node_modules\deasync: Command failed.
Exit code: 1
Command: node ./build.js
Arguments:
Directory: C:\Users\teyc\AppData\Local\Yarn\Data\global\node_modules\deasync
Output:
C:\Users\teyc\AppData\Local\Yarn\Data\global\node_modules\deasync>if not defined npm_config_node_gyp (node "C:\Program Files\nodejs\node_modules\npm\bin\node-gyp-bin\\..\..\node_modules\node-gyp\bin\node-gyp.js" rebuild )  else (node "" rebuild )
gyp info it worked if it ends with ok
gyp info using node-gyp@7.1.2
gyp info using node@15.0.1 | win32 | x64
gyp info find Python using Python version 3.7.3 found at "C:\Users\teyc\AppData\Local\Programs\Python\Python37-32\python.exe"
gyp ERR! find VS
gyp ERR! find VS msvs_version not set from command line or npm config
gyp ERR! find VS VCINSTALLDIR not set, not running in VS Command Prompt
gyp ERR! find VS checking VS2019 (16.8.30717.126) found at:

我不想安装编译器。是否有可供下载的二进制文件?

【问题讨论】:

    标签: node-gyp node-deasync


    【解决方案1】:

    不幸的是,deasync 节点包可能不包含您的节点版本和操作系统的所有二进制文件,yarn 在运行 create react-app 时需要它,而npx 没有。

    您的选择是:

    1. 了解如何将预构建的二进制文件下载到您的系统中

    https://github.com/abbr/deasync-bin

    1. 使用npx
    npx create react-app my-project --template typescript
    
    1. 使用yarn 2。这是我更喜欢的方法,因为它消耗的磁盘空间更少
    yarn set version berry
    yarn create react-app myproject --template typescript
    

    【讨论】:

      猜你喜欢
      • 2022-06-14
      • 1970-01-01
      • 2022-08-18
      • 1970-01-01
      • 1970-01-01
      • 2021-02-17
      • 1970-01-01
      • 2018-01-18
      • 2022-01-15
      相关资源
      最近更新 更多