纱线添加不起作用

QJa*_*n84 5 yarnpkg mdc-components

我无法安装分叉的 git 存储库。我想安装版本#0.31.0。

yarn add https://github.com/Goldjan/material-components-web.git#v0.31.0
Run Code Online (Sandbox Code Playgroud)

我收到以下错误:

C:\Users\qjan8\Websites\XXXXXX>yarn add https://github.com/Goldjan/material-components-web.git#v0.31.0
yarn add v1.7.0
[1/4] Resolving packages...
error Can't add undefined: invalid package version undefined.
info Visit https://yarnpkg.com/en/docs/cli/add for documentation about this command.
Run Code Online (Sandbox Code Playgroud)

这必须是 的名称吗package.json

fre*_*ett 5

我遇到了类似的问题,我尝试添加为依赖项的存储库versionpackage.json. 添加该内容解决了问题。