-
Notifications
You must be signed in to change notification settings - Fork 58
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
fix: fix parallel install from local directory #398
Conversation
// use npm pack to ensure npmignore/gitignore/package.files work fine | ||
const res = await cp.exec('npm pack', { cwd: filepath }); | ||
const res = await cp.exec('npm pack', { cwd: tmpDir }); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
npm pack 没有提供指定打包位置的方式,最保险就是把整体放到一个临时目录来打包,避免并发时的冲突。
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
会慢一点,但是使用 local 的包应该不多,影响不大。
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
https://docs.npmjs.com/cli/v8/commands/npm-pack#pack-destination npm8 有这个。下个月我们可以升级到这个版本。
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
等不了下个月了,先解决问题...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
升级到 npm8 的时候重构一下就行
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
docs.npmjs.com/cli/v8/commands/npm-pack#pack-destination npm8 有这个。下个月我们可以升级到这个版本。
这个也看到了,等升级 npm 8 的时候我来蹭 PR 吧 hhhh
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
想到一种更好的方法。可以用 npm-packlist 这个包获取到所有的文件,然后直接 cp 就好了,不需要 tgz 了。
ec7446b
to
568db72
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
我只发到 5.8.1,6.x 到时候升级到 npm8 重新实现? |
No description provided.