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.
yarn global add yo ; yo --version文件名、目录名或卷标语法不正确。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.
@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是正确的
This is a bug with cmd-shim when Node.js is on a different hard-drive than Yarn's cache: https://github.com/ForbesLindesay/cmd-shim/issues/21. It should be fixed in cmd-shim. Once a new version is available, we can update the dependency in Yarn.
Most helpful comment
@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是正确的