Skip to content

When installing global modules, Yarn tries to create .cmd file in wrong directory #2192

@gaearon

Description

@gaearon

What is the current behavior?

Yarn fails to install create-react-app:

C:\Users\gaearon>yarn global add create-react-app
yarn global v0.17.10
[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: "EPERM: operation not permitted, open 'C:\\Program Files\\nodejs\\create-react-app.cmd'".
info If you think this is a bug, please open a bug report with the information provided in "C:\\Users\\gaearon\\AppData\\Local\\Yarn\\config\\global\\yarn-error.log".
info Visit https://yarnpkg.com/en/docs/cli/global for documentation about this command.

I have no such problem with npm:

C:\Users\gaearon> npm i -g create-react-app
C:\Users\gaearon\AppData\Roaming\npm\create-react-app -> C:\Users\gaearon\AppData\Roaming\npm\node_modules\create-react-app\index.js
C:\Users\gaearon\AppData\Roaming\npm
`-- [email protected]
  ...

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

yarn global add create-react-app

What is the expected behavior?

It gets installed.

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

Node 6.9.2
Yarn 0.17.10
Windows 10 Enterprise 10.0.14393 Build 14393

Yarn log

https://gist.github.com/gaearon/e67437d7a4102fe696a34dec2c7fe825

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions