Yarn global installs to current directory

房东的猫 提交于 2019-12-06 08:49:00

Edit

Now it works:

yarn config set prefix /usr/local

Check with

yarn config get prefix

Notice that only executables will be installed to this prefix location. Packages i.e. on Windows are installed in %USERPROFILE%\AppData\Local\Yarn\config\global\node_modules.

On Windows I do:

mkdir ~/yarn-global
yarn config set prefix ~/yarn-global

Old

Global path isn't configurable permanently yet. We can only read the settings:

> yarn global bin
C:\Program Files\nodejs

When I tried to install elm-upgrade, I got error in log %USERPROFILE%\AppData\Local\Yarn\config\global\yarn-error.log

Trace:
  Error: EPERM: operation not permitted, open 'C:\Program Files\nodejs\elm-upgrade.cmd'
      at Error (native)

But elm-upgrade was installed in %USERPROFILE%\AppData\Local\Yarn\config\global\node_modules\.bin.

Related:

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!