Ant-design-pro: 解决npm run fetch:blocks问题

Created on 15 Jul 2019  ·  12Comments  ·  Source: ant-design/ant-design-pro

分享一下解决经验:
问题:npm run fetch:blocks在login卡死,不再继续;npm run fetch:blocks正确执行,但是src/pages下无文件。
解决办法:下载https://github.com/ant-design/pro-blocks/tree/master/,解压。打开node_modlue文件夹下的fetch-blocks/src/fetch-blocks.js,将所有umi block add之后的路径改为的文件夹路径修改到为你解压的下载的git上的文件夹。
之后npm run fetch:blocks,成功。

Most helpful comment

解决经验:
1、下载https://github.com/ant-design/pro-blocks
2、将下载的文件解压拷贝到C:\Users\用户名\.umi\blocks\github.com\ant-design\pro-blocks文件夹下
3、执行npm run fetch:blocks

All 12 comments

将所有umi block add之后的路径改为的文件夹路径修改到为你解压的下载的git上的文件夹。

这个没有看懂又实操的图片 或者 gif 吗?

我用的ubuntu18.04 不太会截图,我详细描述一下过程:
fetch-blocks.js第126行,159行源代码为 umi block add https://github.com/ant-design/pro-blocks/tree/master/${gitPath},我修改为umi block add /home/famlee/pro-blocks-master/${gitPath},其实就是把git的路径换成了本地路径。

之前这个代码我在我不能正确执行时候测试过,卡死的地方在fetch-blocks.js第141行 await execCmd(cmd.join(" "), cwd); ubuntu18.04 sudo之后也不行,我怀疑不是代码问题,是我系统的问题。

我找个 ubuntu 试试。你这个方法很不错呀,有兴趣沉淀一个文章吗?
fetch-blocks 可以支持你的这个方法,我增加一个 repo 的参数

我是搞嵌入式的,搞前端很业余的,我可以详细整理一下过程。其实概括起来解决思路就是,把文件搞到本地解决。一会我转到win10截图一下,编辑一下详细的解决过程。

好的。非常感谢

你们是怎么快速的下载完的?
我npm run fetch:blocks可以下载6-7个小时还没下完
慢的不得了,我科学上网开着也下的极慢。
至于你说的方法执行到 install analysis to: /dashboard/analysis的时候几乎就不动了。
我add后面的地址为:......add file:///E:/google/....../pro-blocks-master/${gitPath}

@Helaiqu win 用户无法使用这个技巧的,路径的嵌套规则不一样

解决经验:
1、下载https://github.com/ant-design/pro-blocks
2、将下载的文件解压拷贝到C:\Users\用户名\.umi\blocks\github.com\ant-design\pro-blocks文件夹下
3、执行npm run fetch:blocks

npm run fetch:blocks

同样会卡在第二个login...

我也是 login成功以后 下一个还是login。。。

⚠ 🧐 find config.ts ...
✔ 🧐 find config.js ...
⠋ 📦 install login to: /user/login✔ success probable url http://localhost:8000/user/login (copied to clipboard) for view the block.
⠋ 📦 install login to: /user/login

我也是 login成功以后 下一个还是login。。。

⚠ 🧐 find config.ts ...
✔ 🧐 find config.js ...
⠋ 📦 install login to: /user/login✔ success probable url http://localhost:8000/user/login (copied to clipboard) for view the block.
⠋ 📦 install login to: /user/login

基本可以排除是网络问题了

Was this page helpful?
0 / 5 - 0 ratings

Related issues

lvzheng0404 picture lvzheng0404  ·  3Comments

skyFi picture skyFi  ·  3Comments

RichardStark picture RichardStark  ·  3Comments

Jerry-goodboy picture Jerry-goodboy  ·  3Comments

renyi818 picture renyi818  ·  3Comments