Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Where does Yarn add global binaries on Windows?

Tags:

yarnpkg

tsc

I'm on Windows 7, and I tried to install typescript with yarn:

yarn global add typescript

success Installed [email protected] with binaries:
  - tsc
  - tsserver
Done in 11.59s.

After successful installation, I type tsc in the command line, only to find that the command is not available.

yarn tsc
yarn tsc v0.16.1
error Command "tsc" not found.

Get config:

yarn config get prefix
C:\Program Files (x86)\Nodist\bin

I checked this path: there's no tsc or tsserver exectuables. Where is it?

like image 890
Nick Avatar asked Oct 26 '16 09:10

Nick


People also ask

Where does yarn install global binaries?

yarn will ensure all global packages will have their executables installed to ~/. yarn/bin .

How do I add yarn to global path in Windows?

If you want to access Yarn's executable globally, you need to set up the PATH environment variable in your terminal by adding export PATH="$PATH:`yarn global bin`" to your profile, or you if you are familiar with fish, you set PATH $PATH (yarn global bin) in the ~/. config/fish/config.

Where do yarn packages get installed?

Difference 1: Installation location A locally installed package gets installed in the directory where you executed the npm install package-name (or yarn add package-name ) command. Specifically, you will find a project's locally installed packages in its node_module directory.


1 Answers

Answering the actual question and using the default directory, rather than changing it:

Yarn installs to ${env:LOCALAPPDATA}\yarn\bin

You can see this with:

yarn global bin

For example, after installing gulp:

$ ls ${env:LOCALAPPDATA}\yarn\bin


    Directory: C:\Users\mike\AppData\Local\yarn\bin


Mode                LastWriteTime         Length Name
----                -------------         ------ ----
-a----        13-Aug-18   4:11 PM            348 gulp
-a----        13-Aug-18   4:11 PM             57 gulp.cmd

To ensure it's in your path, add this to your $profile (assuming you have PSCX ):

Add-PathVariable ${env:LOCALAPPDATA}\yarn\bin
like image 119
mikemaccana Avatar answered Oct 18 '22 04:10

mikemaccana