我可以安装一个GitHub包,但不能安装其他纱线.请告诉我这里可能出现的问题.
我可以添加https://github.com/fancyapps/fancybox#3.0 但不能添加https://github.com/opentripplanner/otp-react-redux#result-post-processor
ravis-MacBook-Pro:gitprojects raviramadoss$ mkdir test
ravis-MacBook-Pro:gitprojects raviramadoss$ cd test
ravis-MacBook-Pro:test raviramadoss$ yarn init
yarn init v1.6.0
question name (test):
question version (1.0.0):
question description:
question entry point (index.js):
question repository url:
question author:
question license (MIT):
question private:
success Saved package.json
? Done in 11.54s.
ravis-MacBook-Pro:test raviramadoss$ yarn add https://github.com/fancyapps/fancybox#3.0
yarn add v1.6.0
info No lockfile found.
[1/4] Resolving packages...
[2/4] Fetching packages...
[3/4] Linking dependencies...
warning " > @fancyapps/fancybox@3.0.48" has unmet peer dependency "jquery@>=1.9.0".
[4/4] Building fresh packages...
success Saved lockfile.
success Saved 1 new dependency.
info Direct dependencies
?? @fancyapps/fancybox@3.0.48
info All dependencies
?? @fancyapps/fancybox@3.0.48
? Done in 1.35s.
ravis-MacBook-Pro:test raviramadoss$ yarn add https://github.com/opentripplanner/otp-react-redux#result-post-processor
yarn add v1.6.0
[1/4] Resolving packages...
error Can't add "otp-react-redux": invalid package version undefined.
info Visit https://yarnpkg.com/en/docs/cli/add for documentation about this command.
ravis-MacBook-Pro:test raviramadoss$
Run Code Online (Sandbox Code Playgroud)
pat*_*pan 25
您需要使用git remote url并在hash(#)之后指定分支.
yarn add https://github.com/opentripplanner/otp-react-redux.git#result-post-processor
Run Code Online (Sandbox Code Playgroud)
从特定git分支,git commit或git标签的远程git存储库安装软件包.
yarn add <git remote url>#<branch/commit/tag>
Far*_*zan 15
更新
请注意,对于 Yarn 2+,您需要在 URL 前添加包名称前缀:
yarn add otp-react-redux@https://github.com/opentripplanner/otp-react-redux#head=result-post-processor
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
8393 次 |
| 最近记录: |