Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

淘宝源与 pnpm 不兼容,cnpmjs 源偶发 #1458

Closed
sodatea opened this issue Apr 23, 2019 · 9 comments
Closed

淘宝源与 pnpm 不兼容,cnpmjs 源偶发 #1458

sodatea opened this issue Apr 23, 2019 · 9 comments

Comments

@sodatea
Copy link

sodatea commented Apr 23, 2019

复现仓库

https://github.com/sodatea/pnpm-taobao-test

复现步骤

npm i -g pnpm

git clone https://github.com/sodatea/pnpm-taobao-test.git
cd pnpm-taobao-test
pnpm i

说明

如果用 https://registry.npm.taobao.org/ 作为源,每次安装都会卡住,强行 Ctrl + C 会看到 400 Bad Request 报错

如果用 https://r.cnpmjs.org/ 的话,偶尔会出现这个错误,大部分情况下正常

请问这两个源有何区别?

碰到这个问题是因为 Vue CLI 3 中增加了对网络状况的检测,发现用户到 npmjs.org 的连接过慢时会建议用淘宝源。而最近的 3.6 中新增了 pnpm 客户端的支持,结果测试中发现指定用淘宝源安装肯定会失败。

如果 Bug 不好定位/修复,且这两个源区别不大的话,Vue CLI 考虑改用 r.cnpmjs.org 作为中国用户的默认源,这样是否推荐?

@Akimotorakiyu
Copy link

同样的问题:
pnpm/pnpm#1785

@fengmk2
Copy link
Member

fengmk2 commented Apr 23, 2019

具体是什么原因不兼容呢?

@sodatea
Copy link
Author

sodatea commented Apr 23, 2019

抓了下包是有个 302 请求被重定向到 http://cdn.npm.taobao.org:443/eslint-loader/-/eslint-loader-2.1.2.tgz……

@fengmk2
Copy link
Member

fengmk2 commented Apr 23, 2019

@sodatea 我使用最新的 pnpm 测试你的代码库,ok的啊

image

@sodatea
Copy link
Author

sodatea commented Apr 23, 2019

@fengmk2 刚想说……复现里不小心加了 lockfile 导致结果不一样……

rm -rf node_modules pnpm-lock.yaml
rm -rf ~/.pnpm-store
pnpm i

再试试?

@fengmk2
Copy link
Member

fengmk2 commented Apr 23, 2019

image

@fengmk2
Copy link
Member

fengmk2 commented Apr 23, 2019

已经定位到问题,通过 7f0c141 修复。等会重新部署即可。

@sodatea
Copy link
Author

sodatea commented Apr 23, 2019

👍效率好高

@fengmk2
Copy link
Member

fengmk2 commented Apr 23, 2019

@sodatea 好了,修复了。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants