-
Notifications
You must be signed in to change notification settings - Fork 2.7k
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
Can not run globally installed packages which are installed with yarn #2224
Comments
Might be specific to Git Bash or MinGW... Try it in a regular cmd.exe and see if it works there? |
Nope. cmd.exe is not working too. When I write name of package cmd window
just disappears.
12 Дек 2016 г. 3:45 пользователь "Daniel Lo Nigro" <[email protected]>
написал:
… Might be specific to Git Bash or MinGW... Try it in a regular cmd.exe and
see if it works there?
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
<#2224 (comment)>, or mute
the thread
<https://github.com/notifications/unsubscribe-auth/AFXK_jl2aerPmGRLeLRjCA3Mk-6mE8aaks5rHJkdgaJpZM4LKEVk>
.
|
+1 after yarn global add http-server "$basedir/../../Users/{username}/AppData/Local/Yarn/config/global/node_modules/.bin/http-server.cmd" "$@"
exit $? console can't known the |
Hm. I am trying to get what is |
I have the same exact problem when installing global packages using yarn and I have the same environment as @sharikovvladislav. I tried installing different packages globally with similar results and |
Was able to repro. I tracked the issue down to the cmd-shim library. .....global\node_modules.bin\uglifyjs.cmd
I did run into a separate issue where my Yarn bin path wasn't set correctly. I use the nodist node version manager on this machine. The choco Yarn install set After manually setting that path, the above workaround script functioned as expected. |
I ran into this error as well, but before checking online I decided to try upgrading yarn to see if that fixed my problem - only problem is now the yarn package itself is showing this error. I've tried removing the files manually from the appData\local\yarn folder but it is still showing me the error. Any idea how I can remove the packages from yarn and use npm instead for now as all of my work code written with angular-cli is now unusable until either this is fixed or I can get my "ng" command to point back to an npm version. |
You should check the global folder |
@modulexcite ah, I had deleted all the files from the global/node_modules folder but I hadn't deleted the ones from inside the nodejs installation - thanks 😄 |
@markheron91 Glad to help, hopefully this will get fixed in the next release. |
Now that #1043 landed behaviour described in the quote is gone, but global packages still wont run from MINGW64. (At least it works from
Contents of both I guess for now I still have to use npm for installation of global packages if I want those to work in Git Bash |
+1 @"%~dp0\C:\Users\myuser\AppData\Local\Yarn\config\global\node_modules\.bin\browserify.cmd" %* In this case executable path gets resolved to This is obviously wrong. To clarify, this only happens when I have Yarn installed via Chocolatey, and then Yarn is installed to If Yarn is installed using @"C:\Users\myuser\AppData\Local\Yarn\config\global\node_modules\.bin\browserify.cmd" %* My Yarn version is 0.19.1. |
This issue was resolved in v0.19.1. I'm now able to install packages globally using yarn.
|
But can you use them from MINGW64? |
@iwasawafag I can run globally installed packages using yarn (v0.19.1) from |
I tried to install packages globally with yarn. Everything worked fine. I also tried it from MINGW64. I think this can be closed as resolved. |
Hm... I'm also on Win 7 x64 with git 2.10.0.windows.1. This got me to try and change few things and I noticed different behavior: When I don't know in which case it works incorrectly. Considering that Yarn's installer does not add anything else to PATH to make global packages available it looks like it's supposed to create those scripts in node's dir. I fixed it for myself by prepending Perhaps, I should open another issue about this behavior. |
@iwasawafag Your problem is probably related to It seems in the absence of a |
Now I see what's going on. It has something to do with Thanks for helping me figure this out |
I was using Git along with Cmder which was still using 2.6.3.windows.1. After updating Git to 2.11.0.windows.3 yarn is giving me output again. |
This problem occurs again. |
Same issue on Mac, happens every time I run an update alias including |
yarn 0.21.3 Example: Installed gulp as global Resulting gulp.bat in F:\Program Files\nodejs @"%~dp0\C:\Users\user.name\AppData\Local\Yarn\config\global\node_modules.bin\gulp.cmd" %* expands to @"F:\Program Files\nodejs\C:\Usersuser.namel\AppData\Local\Yarn\config\global\node_modules.bin\gulp.cmd" The batch file does not like %~dp0 (expands to F:\Program Files\nodejs\) if you remove %~dp0\ and just use @"C:\Users\user.name\AppData\Local\Yarn\config\global\node_modules.bin\gulp.cmd" %* |
FYI I once installed yarn via npm (I know, bad idea) and I had to use Of course I had to reinstall the package with the binary (in my case gulp) after setting the global binary installation directory.
But of course the binary I had installed via npm was still being loaded via the nvm binary directory (which I added to my $PATH as well), as I noticed by doing:
This meant I had to remove that file ( Hope that helps others in a similar situation. |
* Persist cache * Add persistent global bin to yarn
Same issue here, but thanks to the above comments I noticed that my bin dir ( |
That's interesting... The installer should have added it to the path. So
far I haven't been able to replicate any issues with the path missing after
installing Yarn.
Sent from my phone.
On Oct 11, 2017 12:57 PM, "Tim Malone" <[email protected]> wrote:
Same issue here, but thanks to the above comments I noticed that my bin dir
(C:\Users\Tim\appdata\local\yarn\bin) was not in PATH. I'm not sure why...
but at least adding it to PATH was a quick fix.
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
<#2224 (comment)>, or mute
the thread
<https://github.com/notifications/unsubscribe-auth/AAFnHRUaGPSy5L_eS9SZdE_vNa6vB9t5ks5srCCjgaJpZM4LKEVk>
.
|
Interesting, installed latest Yarn 1.2.1 with Actually, there're only I found all the shell scripts and .cmd scripts in Also, there was no yarn path added to the system path. I added the .bin path to the system path manually, and everything works fine. Questions:
|
I do not remember how I originally installed yarn. To be sure I removed it using Now there is still no bin folder in And global installs are not found when typed in the console. |
I've installed polymer-cli globally on a Linux box, but polymer isn't in the path.
|
@dandv - Are you sure the Yarn directory is in your path? Try |
hm. Is this problem still exists? I don't have this even on yarn v 1.0.2. I am not able to reproduce this. |
@Daniel15 - I have the path problem using zsh. |
This means you haven't added it to your |
thanks @modulexcite, your #2224 (comment) solve my problem. in my case, i tried to install globally
After several failed attempts, I finally came across your comment, found |
I am still experiencing this error on windows while I install any package like @vue/cli globally with |
windows 10 : |
Thanks for spot that. But I still miss why that path should have been manually added |
This is still correct. I just tested with |
Do you want to request a feature or report a bug?
Bug
What is the current behavior?
I can not run globally installed packages (uglifyjs, eslint etc).
Looks like there are problems with path. When I run (you full steps can see below) commands I get errors about path is incorrect. Path is:
/d/Dev/nodejs/C:/Users/Vlad/AppData/Local/Yarn/config/global/node_modules/.bin/uglifyjs
.It is not problem with
uglifyjs
. If I will installeslint
globally or something like that I am getting same behaviour.I am trying to do this in Git Bash terminal (MINGW64). If I try to run same command in cmd, cmd window is just disappearing. I also tried to create
.cmd
file and run commands from this file via:cmdFileName >> xx.txt
. I got this in output:If the current behavior is a bug, please provide the steps to reproduce.
uglify-js
(or anything else) globally (from npm):Output is:
What is the expected behavior?
I expect that I can run
uglifyjs
(oreslint
or any other pacakges) command without errors after it.Please mention your node.js, yarn and operating system version.
NodeJS v 7.0.0
Yarn v v0.17.10
OS v Windows 7 Ultimate x64
The text was updated successfully, but these errors were encountered: