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

yarn global add yo but yo not work #2630

Closed
anjia0532 opened this issue Feb 4, 2017 · 2 comments
Closed

yarn global add yo but yo not work #2630

anjia0532 opened this issue Feb 4, 2017 · 2 comments

Comments

@anjia0532
Copy link

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

What is the current behavior?
yo --version throws exception 文件名、目录名或卷标语法不正确。
If the current behavior is a bug, please provide the steps to reproduce.

  1. install nodejs v7.5.0 change path to ${nodejs_home}
  2. change prefix : ${nodejs_home} and change cache : ${nodejs_home} \node_cache
  3. install yarn v0.19.1 change path to ${yarn_home}
  4. change cache dir : ${yarn_home}\cache
  5. yarn global add yo ; yo --version
    output error msg 文件名、目录名或卷标语法不正确。

What is the expected behavior?

yo --version
# output 1.8.5

Note
i modify ${nodejs_home} \yo.cmd

#before 

@"%~dp0\C:\Users\${userName}\AppData\Local\Yarn\config\global\node_modules\.bin\yo.cmd"   %*


#after
# remove %~dp0\ like this

@"C:\Users\${userName}\AppData\Local\Yarn\config\global\node_modules\.bin\yo.cmd"   %*

is successful !

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

  • OS Version Windows 10 1607(os version 14393.693)
  • Nodejs version v7.5.0
  • yarn version v0.19.1
  • yo version 1.8.5
  • powershell v1
@ptzhuf
Copy link

ptzhuf commented Apr 18, 2017

@anjia0532 你需要在path把C:\Users\win7\AppData\Local\Yarn\config\global\node_modules\.bin 加到
D:\Program Files\nodejs\; nodejs的path前面, 这样才能正确识别到正确的 yo.cmd.

node_modules\.bin下的yo.cmd是正确的

@Daniel15
Copy link
Member

Daniel15 commented Apr 23, 2017

This is a bug with cmd-shim when Node.js is on a different hard-drive than Yarn's cache: npm/cmd-shim#21. It should be fixed in cmd-shim. Once a new version is available, we can update the dependency in Yarn.

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

No branches or pull requests

3 participants