-
Notifications
You must be signed in to change notification settings - Fork 3.2k
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
"immer": "^8.0.4",版本过低,扫描有安全问题,能不能升级一下到9.0.6 #2491
Comments
希望能升级啊 |
一方面可以在package.json中强制指定immer {
"dependencies": {
"dva-immer": "^1.0.0"
},
"resolutions": {
"dva-immer/immer": "^9.0.6"
}
} 另一方面,考虑弃坑 #2490 |
我试过了,这个方法不行呢!我用的是umi框架,里面直接内嵌dva,坑死 |
如果直接依赖不是 {
"你的依赖/中间依赖a/b/c/immer": "^9.0.6"
} 中间依赖需要你自己去 |
试过了大佬的方法,.lock文件版本已经到9.0.6,但是node_modules immer版本还是8.0.4 |
不,你要看目录 {
"resolutions": {
"umi-plugin-react/umi-plugin-dva/dva-immer/immer": "^9.0.6"
}
} |
一切都是以node_modules/dva-immer/node_modules/immer版本号为主,lock文件夹里面的版本号不能作为依据? |
你可能不太清楚require的规则 http://nodejs.cn/api/modules/loading_from_node_modules_folders.html 然后就是umi项目里,依赖到immer的地方太多,各个immer版本都有,所以lock文件里应该是有很多immer的并且都不兼容 yarn why immer |
嗯嗯,是的,dva-immer里面的immer插件还是不行,那边依赖的8.0.4版本直接按需下载在dva-immer的node_modules,好像没办法强行修改它的依赖 |
还有一个办法就是把所有用到immer的库都加入到 |
|
你这个resolutions写的。。。plugin-dva是你自己装的吗? {
"resolutions": {
"umi-plugin-react/umi-plugin-dva/dva-immer/immer": "^9.0.6",
"umi/umi-ui/react-dev-utils/immer": "^9.0.6",
"umi-plugin-react/umi-plugin-ui/immer": "^9.0.6",
"umi/umi-build-dev/umi-plugin-ui/immer": "^9.0.6"
}
} 然后lock文件会呈现出下面的状态
如果还不行,说明你的其它插件里也带了immer,需要你在yarn.lock里找到并写进resolutions。记住,开头必须是你自己装的插件 |
谢谢大佬,之前大概是用npm,改成了yarn就好了 |
新项目考虑换成这个库,带你飞:https://github.com/foca-js/foca |
可以的,下次项目试试大佬的,以后再也不用这个库了,太坑了! |
What happens?
最小可复现仓库
复现步骤,错误日志以及相关配置
相关环境信息
The text was updated successfully, but these errors were encountered: