ali-oss
ali-oss copied to clipboard
使用 6.18.1 版本在 next.js 框架下以及 nodejs v18.14.2 环境中提示依赖 proxy-agent implementation 找不到
版本信息:
- node.js v18.14.2
- next.js 14.0.4-canary.17
- ali-oss 6.18.1
问题:
- 能正常上传图片资源,但上传完后开发环境会报错提示两个包找不到,来自 ali-oss 中的 urllib 包:
23 | // if implementation specified, require it
> 24 | var lib = require(implementation)
2 | debug('create new proxy %s', proxy);
23 | // lazy require, only support node >= 4
> 24 | proxyAgent = proxyAgents[proxy] = new (require('proxy-agent'))(proxy);
麻烦手动安装一下proxy-agent 5.x版本,urllib 2.X里将其作为了一个可选的peerDependencies