-
Notifications
You must be signed in to change notification settings - Fork 2.1k
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
fix: get npm client from storage #2473
fix: get npm client from storage #2473
Conversation
@@ -186,7 +187,8 @@ export default class Dependency implements IDependencyModule { | |||
|
|||
socket.emit('adapter.dependency.upgrade.data', i18n.format('baseAdapter.dependency.reset.startInstall', {packageName})); | |||
|
|||
const childProcess = execa('npm', ['update', packageName, '--silent'], { | |||
const npmClient = this.storage.get('npmClient'); |
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.
两个获取可以提到最上面吗,只写一行?
@@ -0,0 +1,13 @@ | |||
import { checkAliInternal } from 'ice-npm-utils'; | |||
|
|||
const getStorageNpmClient = async (storage: any) => { |
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.
考虑在这里直接引入 storage 文件,不用在每个调用的地方都去传一遍?
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.
done
No description provided.