[英]Cannot find module @restart/context/forwardRef during npm build
我最近在升级到较新版本的react-bootstrap
( 1.0.0-beta.6
) 后开始遇到npm build
问题。
Creating an optimized production build...
Failed to compile.
Cannot find module: '@restart/context/forwardRef'. Make sure this package is installed.
./node_modules/react-bootstrap/es/ThemeProvider.js
You can install this package by running: yarn add @restart/context/forwardRef.
我尝试运行提供的yarn
命令,但这不是有效的包名称。 有没有人知道如何在不回到旧版本的情况下解决这个问题(它不支持标签,这是我正在使用的东西)?
这是@restart/context的上游问题,它刚刚发布了一个版本,该版本中断了像这样导入forwardRef
:
import forwardRef from '@restart/context/forwardRef'
快速修复是通过运行yarn add @restart/context@2.1.2
降级到yarn add @restart/context@2.1.2
。
长期修复是等待react-bootstrap
修复它们的导入或将它们的package.json
锁定到这个版本的@restart/context
。
编辑:我在react-bootstrap
库中添加了一个问题以在此处跟踪进度: https : //github.com/react-bootstrap/react-bootstrap/issues/3576
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.