Chui Tey
Chui Tey

Reputation: 5574

yarn - installation of deasync fails

When I create a react app on Windows with node 15 like this:

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

It fails with

yarn create v1.22.11
[1/4] Resolving packages...
[2/4] Fetching packages...
info [email protected]: The platform "win32" is incompatible with this module.
info "[email protected]" is an optional dependency and failed compatibility check. Excluding it from installation.
info [email protected]: The platform "win32" is incompatible with this module.
info "[email protected]" 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 [email protected]
gyp info using [email protected] | 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:

I don't want to install compilers. Are there binaries available for downloading?

Upvotes: 1

Views: 3457

Answers (1)

Chui Tey
Chui Tey

Reputation: 5574

Unfortunately, the deasync node package might not contain every binary for your node version and operating system, and yarn for some inexplicable reason requires it when running create react-app while npx doesn't.

Your options are:

  1. Figure out how to download the prebuilt binaries into your system

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

  1. use npx
npx create react-app my-project --template typescript
  1. use yarn 2. This is the method I prefer as it consumes less disk space
yarn set version berry
yarn create react-app myproject --template typescript

Upvotes: 1

Related Questions