yarnpkg/yarn

Missing global dependency generates unhelpful message

开放

#5,134 创建于 2017年12月28日

 (3 条评论) (0 个反应) (1 位负责人)JavaScript (2,731 个派生)batch import
cat-featuregood first issuehelp wantedtriaged

仓库指标

星标
 (41,514 个星标)
PR 合并指标
 (PR 指标待抓取)

描述

Do you want to request a feature or report a bug? Bug - Unhelpful error message

What is the current behavior?

Commands like yarn global list are failing on my system with the message error "C:\\code\\antlr4ts\\tool" doesn't exist. This is of my own doing (I recognize the missing directory, and had intentionally deleted it) but it wasn't clear how to recover. More context on what yarn was doing would have helped.

I tracked it down to the file C:\Users\Burt_\AppData\Local\Yarn\config\global\package.json, which contained:

{
  "dependencies": {
    "antlr4ts-cli": "file:\\code\\antlr4ts\\tool",
    "gulp-cli": "^2.0.0",
    "lerna": "^2.5.1",
    "rimraf": "^2.6.2",
    "typescript": "^2.6.2"
  }
}

Workaround

Once I knew what package was involved, yarn global remove antlr4ts-cli fixed it up.

Stack Trace

verbose 0.669 Error: "C:\\code\\antlr4ts\\tool" doesn't exist.
    at MessageError (C:\Program Files (x86)\Yarn\lib\cli.js:139:5)
    at C:\Program Files (x86)\Yarn\lib\cli.js:48701:15
    at next (native)
    at step (C:\Program Files (x86)\Yarn\lib\cli.js:92:30)
    at C:\Program Files (x86)\Yarn\lib\cli.js:103:13

If the current behavior is a bug, please provide the steps to reproduce. Sorry, I wish I could answer better how I got this entry. As a guess, I must have used something like:

yarn global add file:c:\\code\antlr4ts\tool

What is the expected behavior? Best would be to recover automatically from this using behavior like yarn global remove

Please mention your node.js, yarn and operating system version. os: Microsoft Windows [Version 10.0.16299.125] node: v6.12.2 yarn: 1.3.2 (installed w/ .msi)

贡献者指南