yarnpkg / yarn

The 1.x line is frozen - features and bugfixes now happen on https://github.com/yarnpkg/berry
https://classic.yarnpkg.com
Other
41.43k stars 2.72k forks source link

yarn create fails when specifying a package version #6587

Open Bnaya opened 5 years ago

Bnaya commented 5 years ago

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

What is the current behavior? Running: yarn create react-app@next --help fails with an error:

success Installed "create-react-app@2.0.5-next.c662dfb0" with binaries:
      - create-react-app
/bin/sh: /usr/local/bin/create-react-app@next: No such file or directory

What is the expected behavior? should run /usr/local/bin/create-react-app and not /usr/local/bin/create-react-app@next

Please mention your node.js, yarn and operating system version. yarn 1.10.1, mac os Mojave, node v8.11.3

Note that with npx you need to supply the version using additional flag:

npx create-react-app test-app-typescript --typescript --scripts-version=@next
edmorley commented 5 years ago

This is affecting us too, using yarn 1.12.3, Node.js 11.0.0, Windows 10 x64:

$ yarn create @neutrinojs/project@next foo
yarn create v1.12.3
[1/4] Resolving packages...
[2/4] Fetching packages...
[3/4] Linking dependencies...
[4/4] Building fresh packages...
success Installed "@neutrinojs/create-project@9.0.0-beta.1" with binaries:
      - create-project
'C:\Users\Ed\AppData\Local\Yarn\bin\create-project@next' is not recognized
as an internal or external command, operable program or batch file.
error Command failed.
Exit code: 1
Command: C:\Users\Ed\AppData\Local\Yarn\bin\create-project@next
Arguments: foo
Directory: C:\Users\Ed\src
Output:

It looks like the tag would need to be handled here: https://github.com/yarnpkg/yarn/blob/77f04c34974be96d4acaff81e09034dd1c439fdc/src/cli/commands/create.js#L19-L38