Yarn: Yarn create fails on Windows with "spawn UNKNOWN"

Created on 30 May 2017  路  12Comments  路  Source: yarnpkg/yarn

Do you want to request a feature or report a bug?

Bug

What is the current behavior?

Running yarn create with create-react-app or with the tool I'm building (create-monorepo) fails, throwing a spawn UNKNOWN error (more details below).

If the current behavior is a bug, please provide the steps to reproduce.

$ yarn create react-app example-app
yarn create v0.24.6
warning No license field
[1/4] Resolving packages...
[2/4] Fetching packages...
[3/4] Linking dependencies...
[4/4] Building fresh packages...
success Installed "[email protected]" with binaries:
      - create-react-app
warning No license field
error An unexpected error occurred: "spawn UNKNOWN".
info If you think this is a bug, please open a bug report with the information provided in "C:\\Users\\ggrau\\AppData\\Local\\Yarn\\config\\global\\yarn-error.log".
info Visit https://yarnpkg.com/en/docs/cli/create for documentation about this command.

Global installation of create-react-app actually succeeds, since running create-react-app example-app actually succeeds, but not with yarn create.

The same error occurs with yarn create monorepo.

What is the expected behavior?

Error should not be thrown, and the create-react-app script should be launched.

Please mention your node.js, yarn and operating system version.

Node v7.10.0
yarn 0.24.6
Windows 7 SP1

The problem also occurs on the same PC running Node v7.4.0, and on another PC running Node v7.9.0. It does not occur on macOS Sierra (10.12), Node 7.8.0.

help wanted os-windows triaged

Most helpful comment

It is still not resolved. please fix it.
I getting this error right now:

C:MMReact>yarn create react-app redux-course
yarn create v0.27.5
[1/4] Resolving packages...
[2/4] Fetching packages...
[3/4] Linking dependencies...
[4/4] Building fresh packages...
success Installed "[email protected]" with binaries:
- create-react-app
error An unexpected error occurred: "spawn UNKNOWN".
info If you think this is a bug, please open a bug report with the information provided in "C:\Users\USER1\AppData\Local\Yarn\config\global\yarn-error.log".
info Visit https://yarnpkg.com/en/docs/cli/create for documentation about this command.

Node version:
v6.10.0
Yarn version:
v0.27.5
windows 10

All 12 comments

Actually, I'm a bit confused. Yarn's latest stable release seems to be 0.24.6 (the one I have installed via .msi installer), the online docs include yarn create, there's even a blog post covering this feature, and yarn create seems to do something, but the release notes for 0.25.0 are the ones including yarn create as a new feature...

I am also getting this error:
C:\EX>yarn create react-app FFREACTIPY yarn create v0.24.6 warning No license field [1/4] Resolving packages... [2/4] Fetching packages... [3/4] Linking dependencies... [4/4] Building fresh packages... success Installed "[email protected]" with binaries: - create-react-app warning No license field error An unexpected error occurred: "spawn UNKNOWN". info If you think this is a bug, please open a bug report with the information provided in "C:\\Users\\vinod\\AppData\\Local\\Yarn\\config\\global\\yarn-error.log". info Visit https://yarnpkg.com/en/docs/cli/create for documentation about this command.

Yarn version:
0.24.6
Node version:
8.0.0
Platform:
win32 x64
Trace:
Error: spawn UNKNOWN at exports._errnoException (util.js:1026:11) at ChildProcess.spawn (internal/child_process.js:317:11) at Object.exports.spawn (child_process.js:471:9) at Promise (C:\app\vinod\nodejs\node_modules\yarn\lib\util\child.js:53:24) at Promise (<anonymous>) at queue.push (C:\app\vinod\nodejs\node_modules\yarn\lib\util\child.js:52:54) at run (C:\app\vinod\nodejs\node_modules\yarn\lib\util\blocking-queue.js:102:7) at BlockingQueue.maybePushConcurrencyQueue (C:\app\vinod\nodejs\node_modules\yarn\lib\util\blocking-queue.js:117:7) at BlockingQueue.shift (C:\app\vinod\nodejs\node_modules\yarn\lib\util\blocking-queue.js:112:10) at Promise (C:\app\vinod\nodejs\node_modules\yarn\lib\util\blocking-queue.js:62:14)

@guigrpa even I tried [email protected]
I am getting the same error, may be something to do with windows. I used npm to install yarn globally.

````
C:appvinodEXpractice>yarn create react-app my_app
yarn create v0.25.4
warning No license field
[1/4] Resolving packages...
[2/4] Fetching packages...
[3/4] Linking dependencies...
[4/4] Building fresh packages...
success Installed "[email protected]" with binaries:
- create-react-app
warning No license field
error An unexpected error occurred: "spawn UNKNOWN".
info If you think this is a bug, please open a bug report with the information provided in "C:\Users\vinod\AppData\Local\Yarn\config\global\yarn-error.log".
info Visit https://yarnpkg.com/en/docs/cli/create for documentation about this command.

C:appvinodEXpractice>
````

Same issue here. Running create-react-app manually after the error does work so it seems to be an actual yarn issue.

I am getting the same error on Windows 10 with node 8.0.0 and yarn version 0.24.5

I am getting the same error on Windows 10 with node 7.9.0 and yarn version 0.24.5

Same error:
Windows 10
node v8.1.3
yarn v0.27.5

It is still not resolved. Please fix it.

yarn create v0.27.5
warning package.json: No license field
warning No license field
[1/4] Resolving packages...
[2/4] Fetching packages...
[3/4] Linking dependencies...
[4/4] Building fresh packages...
success Installed "[email protected]" with binaries:
- create-react-app
warning No license field
error An unexpected error occurred: "spawn UNKNOWN".
info
If you think this is a bug, please open a bug report with the information provided in "C:\Users\MY-PC\AppData\Local\Yarn\config\global\yarn-error.log".
info
Visit https://yarnpkg.com/en/docs/cli/create for documentation about this command.

I also checked the Yarn log. It shows this at the end of error-log file.

yallist@^2.1.2:
version "2.1.2"
resolved "https://registry.yarnpkg.com/yallist/-/yallist-2.1.2.tgz#1c11f9218f076089a47dd512f93c6699a6a81d52"

Trace:
Error: spawn UNKNOWN
at exports._errnoException (util.js:1024:11)
at ChildProcess.spawn (internal/child_process.js:325:11)
at Object.exports.spawn (child_process.js:493:9)
at Promise (C:UsersSURAJAppDataRoamingnpmnode_modulesyarnlibutilchild.js:53:24)
at Promise ()
at queue.push (C:UsersSURAJAppDataRoamingnpmnode_modulesyarnlibutilchild.js:52:54)
at run (C:UsersSURAJAppDataRoamingnpmnode_modulesyarnlibutilblocking-queue.js:102:7)
at BlockingQueue.maybePushConcurrencyQueue (C:UsersSURAJAppDataRoamingnpmnode_modulesyarnlibutilblocking-queue.js:117:7)
at BlockingQueue.shift (C:UsersSURAJAppDataRoamingnpmnode_modulesyarnlibutilblocking-queue.js:112:10)
at Promise (C:UsersSURAJAppDataRoamingnpmnode_modulesyarnlibutilblocking-queue.js:62:14)

@soorajgusain I don't have this error on the latest master but we have https://github.com/yarnpkg/yarn/issues/4164 on the first run which we are hoping to fix soon.

If you want it sooner, you are welcome to submit a PR which would be greatly appreciated :)

It is still not resolved. please fix it.
I getting this error right now:

C:MMReact>yarn create react-app redux-course
yarn create v0.27.5
[1/4] Resolving packages...
[2/4] Fetching packages...
[3/4] Linking dependencies...
[4/4] Building fresh packages...
success Installed "[email protected]" with binaries:
- create-react-app
error An unexpected error occurred: "spawn UNKNOWN".
info If you think this is a bug, please open a bug report with the information provided in "C:\Users\USER1\AppData\Local\Yarn\config\global\yarn-error.log".
info Visit https://yarnpkg.com/en/docs/cli/create for documentation about this command.

Node version:
v6.10.0
Yarn version:
v0.27.5
windows 10

I had issue with react-native init AwesomeProject that's why I tried yarn in the first place but got this same error. With the react-native command I was prompted to install yarn for a better experience; if not, it will progress without it. Evidently, it did not work.
After seeing the spawn Unknown error with yarn, I decided to try react-native init AwesomeProject again and this time it worked.

Hopefully, some will find this helpful

This is fixed on nightlies, please try them if you need the fix urgently. Otherwise you can wait for the 1.0 release which should happen soon (multiple weeks away).

Was this page helpful?
0 / 5 - 0 ratings