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?
yarn will ensure all global packages will have their executables installed to ~/. yarn/bin .
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.
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.
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
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With