Search code examples
create-react-appyarnpkg

Yarn always ends in error when i use create command


I'm getting this same error every time I try to run the create command with yarn, example with create-react-app:

PS M:\Users\Michael\Documents\GitHub\test> yarn create react-app test-app --template typescript
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.
[3/4] Linking dependencies...
[4/4] Building fresh packages...
success Installed "[email protected]" with binaries:
      - create-react-app
The filename, directory name, or volume label syntax is incorrect.
error Command failed.
Exit code: 1
Command: M:\Users\Michael\Documents\GitHub\test\!\bin\create-react-app
Arguments: test-app --template typescript
Directory: M:\Users\Michael\Documents\GitHub\test
Output:

info Visit https://yarnpkg.com/en/docs/cli/create for documentation about this command.

Maybe I need some environment variable?


Solution

  • This error is from windows.

    I got it fixed by installing create-react-app globally and use it to create app instead of npx.