You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

React项目使用react-addons-update时出现模块未找到错误求助

Fixing "Module not found: Can't resolve 'react-addons-update'" in ReactJS

Hey there! Let's sort out this error you're hitting. The core issue here is that react-addons-update is an old, deprecated utility that's no longer part of React's official maintained tooling—it wasn't installed in your project by default, which is why the module resolver can't locate it. Even better, there's a modern, supported replacement that works exactly like the old package. Here are your solutions:

The immutability-helper package is the direct, actively maintained successor to react-addons-update. It shares the exact same API, so you won't have to change any of your existing code that uses the update method.

  • Install the package via npm or yarn:
    npm install immutability-helper
    # Or if you use yarn:
    yarn add immutability-helper
    
  • Update your import statement from:
    import update from 'react-addons-update';
    
    To:
    import update from 'immutability-helper';
    

That's all! Your code will run just like before, but with a package that gets regular updates and bug fixes.

If you absolutely need to stick with react-addons-update (for legacy code compatibility, for example), you can install the last maintained version. Note that this package is end-of-life and may cause compatibility issues with newer React versions.

  • Install the specific legacy version:
    npm install react-addons-update@15.6.2
    

Once installed, your original import statement will work as intended. Just keep in mind this isn't a long-term solution.

内容的提问来源于stack exchange,提问作者Yogesh Borad

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.05.21 08:14:13