Yarn: electron command not found

Created on 21 Dec 2016  ยท  5Comments  ยท  Source: yarnpkg/yarn

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

bug

What is the current behavior?

I installed electron package:

yarn global add electron
yarn global v0.18.1
warning No license field
[1/4] ๐Ÿ” Resolving packages...
warning electron > electron-download > nugget > progress-stream > through2 > xtend > [email protected]:
[2/4] ๐Ÿšš Fetching packages...
[3/4] ๐Ÿ”— Linking dependencies...
[4/4] ๐Ÿ“ƒ Building fresh packages...
success Installed [email protected] with binaries:
- electron

I can see is it in global package list:
yarn global ls
yarn global v0.18.1
warning No license field
info [email protected] has binaries:

But, when I run electron:
electron
zsh: command not found: electron

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

What is the expected behavior?
electron command should be ok

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

node -v
v6.9.2
uname -a
Darwin MacBook-Pro-2.local 16.1.0 Darwin Kernel Version 16.1.0: Thu Oct 13 21:26:57 PDT 2016; root:xnu-3789.21.3~60/RELEASE_X86_64 x86_64

Most helpful comment

On mac the fix that I have found so far is to add to your path $HOME/.config/yarn/global/node_modules/.bin
So iin zshrc I have

export PATH="$PATH:`yarn global bin`:$HOME/.config/yarn/global/node_modules/.bin"

This at least fixes it temporarily

yarn --version
0.18.1

node --version 
v7.3.0

brew --version
Homebrew 1.1.5
Homebrew/homebrew-core (git revision c1ee; last commit 2016-12-23)

uname -a
Darwin **** 16.3.0 Darwin Kernel Version 16.3.0: Thu Nov 17 20:23:58 PST 2016; root:xnu-3789.31.2~1/RELEASE_X86_64 x86_64

All 5 comments

Here the same with spoof and react-native-cli. And I added export PATH="'yarn global bin':$PATH"

When I look in the bin directory that yarn global bin gif (/usr/local/Cellar/node/7.3.0/bin), only the node binary is available.

ok, I'll try.

Same problem here with global binaries. Problem started after node 7.3 , yarn 18.1 upgrade. On MacOS. Install both of these via homebrew. export PATH="'yarn global bin':$PATH" is in my .zshrc

On mac the fix that I have found so far is to add to your path $HOME/.config/yarn/global/node_modules/.bin
So iin zshrc I have

export PATH="$PATH:`yarn global bin`:$HOME/.config/yarn/global/node_modules/.bin"

This at least fixes it temporarily

yarn --version
0.18.1

node --version 
v7.3.0

brew --version
Homebrew 1.1.5
Homebrew/homebrew-core (git revision c1ee; last commit 2016-12-23)

uname -a
Darwin **** 16.3.0 Darwin Kernel Version 16.3.0: Thu Nov 17 20:23:58 PST 2016; root:xnu-3789.31.2~1/RELEASE_X86_64 x86_64

I can confirm that @plessbd fix resolves my issue and @pcwa-ahendricks issue.

Was this page helpful?
0 / 5 - 0 ratings