tdesign-react icon indicating copy to clipboard operation
tdesign-react copied to clipboard

开发指引走不通

Open lisaiscoding opened this issue 4 years ago • 8 comments

重现链接

https://github.com/Tencent/tdesign-react/blob/develop/CONTRIBUTING.md

重现步骤

git clone --recurse-submodules https://github.com/Tencent/tdesign-react.git
cd tdesign-react
npm i
npm run dev

期望结果

能运行

实际结果

报错

[plugin:vite:import-analysis] Failed to resolve import "../_common/style/web/_reset.less" from "../src/style/index.js". Does the file exist?
image
Environment Info
相关版本 0.26.0
框架版本 / 基础库版本 React
系统、浏览器 macOS Big Sur 11.6.5, 98.0.4758.109 (Official Build) (x86_64)
Node版本 16.13.2

lisaiscoding avatar Mar 09 '22 05:03 lisaiscoding

子仓库拉取使用的是 ssh 协议,是不是没有配置github 的ssh key? common 代码未正常拉取可以手动初始化

git submodule init
git submodule update 

honkinglin avatar Mar 09 '22 15:03 honkinglin

几个小疑问

  1. 需要先配置 ssh 吗
  2. 不配置 ssh 的话,是这样吗
    git clone --recurse-submodules https://github.com/Tencent/tdesign-react.git
    cd tdesign-react
    git submodule init
    git submodule update 
    npm i
    npm run dev
    
  3. 为什么要用 git 子模块呀,我谷歌了一下,很少看到推荐用这个的都觉得用着特麻烦很难用

lisaiscoding avatar Mar 11 '22 08:03 lisaiscoding

  1. 不配置 ssh 的话,是这样吗
    git clone --recurse-submodules https://github.com/Tencent/tdesign-react.git
    cd tdesign-react
    git submodule init
    git submodule update 
    npm i
    npm run dev
    

我试着运行【2】,报这样的错: image

lisaiscoding avatar Mar 11 '22 08:03 lisaiscoding

需要配置 ssh、使用的是 ssh 协议、字模块没有拉取下来运行项目是会报错的,这块用字模块将公共的抽离出去了,其他框架版本组件库公用

boltguo avatar Mar 11 '22 15:03 boltguo

还是不行哎,还差什么前置配置吗?

报错说 .git can't be found

image

但我检查了下是有的

image

lisaiscoding avatar Mar 14 '22 02:03 lisaiscoding

https://docs.github.com/cn/authentication/connecting-to-github-with-ssh/adding-a-new-ssh-key-to-your-github-account 设置一下github 的ssh key吧

honkinglin avatar Mar 17 '22 10:03 honkinglin

解决了,之前配置得有问题。Thx!

lisaiscoding avatar Mar 20 '22 05:03 lisaiscoding

我也把 submodule 改成 https 拉取方式吧,好多人不怎么配置 ssh key

honkinglin avatar Mar 24 '22 05:03 honkinglin