Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUG] "yarn global add tslint" - error execute installed global package #1183

Open
redstrike opened this issue Oct 18, 2016 · 7 comments
Open

Comments

@redstrike
Copy link

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

What is the current behavior?
Randomly ERROR and cannot execute global installed package (Ex: tslint)

C:\Users\myname>yarn global ls
yarn global v0.15.1
warning No license field

Done in 0.05s.

C:\Users\myname>yarn global add tslint
yarn global v0.15.1
warning No license field
[1/4] Resolving packages...
[2/4] Fetching packages...
[3/4] Linking dependencies...
warning Unmet peer dependency "typescript@>=1.7.3".
[4/4] Building fresh packages...
success Installed tslint@3.15.1 with binaries:
      - tslint
Done in 2.67s.

C:\Users\myname>yarn global add typescript
yarn global v0.15.1
warning No license field
[1/4] Resolving packages...
[2/4] Fetching packages...
[3/4] Linking dependencies...
error ENOENT: no such file or directory, open 'C:\Users\myname\AppData\Local\Yarn\.global\node_modules\balanced-match\.np                                                                                                                   mignore'
    at Error (native)
info Visit http://yarnpkg.com/en/docs/cli/global for documentation about this command.

C:\Users\myname>yarn global add typescript
yarn global v0.15.1
warning No license field
[1/4] Resolving packages...
[2/4] Fetching packages...
[3/4] Linking dependencies...
[4/4] Building fresh packages...
success Installed typescript@2.0.3 with binaries:
      - tsc
      - tsserver
Done in 2.89s.

C:\Users\myname>yarn global ls
yarn global v0.15.1
warning No license field
error ENOENT: no such file or directory, open 'C:\Users\myname\AppData\Local\Yarn\.global\node_modules\balanced-match\.npmignore'
    at Error (native)
info Visit http://yarnpkg.com/en/docs/cli/global for documentation about this command.

C:\Users\myname>yarn global ls
yarn global v0.15.1
warning No license field
info tslint@3.15.1 has binaries:
   - tslint
info typescript@2.0.3 has binaries:
   - tsc
   - tsserver
Done in 1.61s.

C:\Users\myname>tslint
< NO OUTPUT, because it forces exiting my cmd >

If the current behavior is a bug, please provide the steps to reproduce.
Try to install a global package, and execute it.

What is the expected behavior?
npm works perfectly. yarn's installed package causes exit my cmd / powershell.

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

  • Windows 10 Pro x64
  • node v6.8.1
  • yarn v0.15.1
@innerspirit
Copy link

I can't run the globally added packages at all.

It looks like yarn adds C:\Users\{user}\AppData\Local\Yarn\.bin to the path, but .bin does not exist. Instead, I added C:\Users\{user}\AppData\Local\Yarn\config\global\node_modules\.bin to my path, and it worked.

@JaKXz
Copy link

JaKXz commented Jan 17, 2017

This is a duplicate of #1585 by the looks of it, but is still an issue on macOS using v0.19.1.

@lingzhong
Copy link

I'm seeing the same issue with

  • OS X El Capitan 10.11.6
  • node v7.4.0
  • yarn 0.19.1

Currently using the workaround of creating symlink from /Users/{user}/.config/yarn/global/node_modules/.../bin to /usr/local/Cellar/node/7.4.0/bin/

@ckuyehar
Copy link

ckuyehar commented Mar 1, 2017

I also experience this issue, that is I couldn't run globally added packages.

I followed @innerspirit suggestion and added C:\Users\chris\AppData\Local\Yarn\config\global\node_modules.bin to my Windows environment path and now its fixed.

@ad0ran
Copy link

ad0ran commented Apr 17, 2017

I had to write this path in manually as well.
Packages still aren't listed under yarn global ls though

@pbasista
Copy link

I cannot reproduce this on linux. Adding typescript and tslint globally works fine:

$ yarn global add typescript
yarn global v0.27.5
warning package.json: No license field
warning No license field
[1/4] Resolving packages...
[2/4] Fetching packages...
[3/4] Linking dependencies...
[4/4] Building fresh packages...
success Installed "typescript@2.4.1" with binaries:
      - tsc
      - tsserver
warning No license field
Done in 1.70s.

$ yarn global add tslint
yarn global v0.27.5
warning package.json: No license field
warning No license field
[1/4] Resolving packages...
[2/4] Fetching packages...
[3/4] Linking dependencies...
[4/4] Building fresh packages...
success Installed "tslint@5.5.0" with binaries:
      - tslint
warning No license field
Done in 1.46s.

The scripts are put in place as expected:

$ ls $(yarn global bin)
semver  tsc  tslint  tsserver

And work as expected:

$ tslint 
Missing files

@pbasista
Copy link

However, when adding eslint globally on the same linux machine:

$ yarn global add eslint
yarn global v0.27.5
warning package.json: No license field
warning No license field
[1/4] Resolving packages...
[2/4] Fetching packages...
[3/4] Linking dependencies...
[4/4] Building fresh packages...
success Installed "eslint@4.2.0" with binaries:
      - eslint
warning No license field
Done in 1.13s.

Its scripts are not put in place for some reason:

$ ls $(yarn global bin)
# does not contain eslint

Probably it is a separate issue, which is better described in #2360.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

10 participants