yarn got error in cygwin Error: Cannot find module 'E:\cygdrive\d\tools\yarn\bin\yarn'

Created on 12 Oct 2016  路  7Comments  路  Source: yarnpkg/yarn

Do you want to request a _feature_ or report a _bug_?
bug
What is the current behavior?

If the current behavior is a bug, please provide the steps to reproduce.
install yarn
open cygwin
yarn --verison
Error: Cannot find module 'E:\cygdrive\d\tools\yarn\bin\yarn'
What is the expected behavior?
got the right version of yarn
Please mention your node.js, yarn and operating system version.
node.js 4.6.7, win7, in cygwin

os-windows

Most helpful comment

@Daniel15 I just use alias yarn=yarn.cmd to work it around.

All 7 comments

Which installation method did you use to install Yarn?

I'm experiencing the same problem. In my case, I use the .msi provided on https://yarnpkg.com/en/docs/install. Yarn works fine under cmd.exe.

Replacing the yarn file content into the bin folder by:

#!/bin/sh
basedir=$(dirname "$(echo "$0" | sed -e 's,\\,/,g')")

case `uname` in
    *CYGWIN*) basedir=`cygpath -w "$basedir"`;;
esac

node "$basedir/yarn.js" "$@"
ret=$?

exit $ret

did the trick for me.

@Daniel15 I use I use the .msi provided on https://yarnpkg.com/en/docs/install

Good catch... yarn should probably be a shell script that handles Cygwin.

@Daniel15 I just use alias yarn=yarn.cmd to work it around.

@gensmusic Thanks for pointing me in the right direction! This pull request should fix it: #1180

Was this page helpful?
0 / 5 - 0 ratings