如何修复-找不到模块:无法解析'@babel/runtime/helpers/objectWithoutPropertiesLoose' [英] How to fix - Module not found: Can't resolve '@babel/runtime/helpers/objectWithoutPropertiesLoose'

查看:36
本文介绍了如何修复-找不到模块:无法解析'@babel/runtime/helpers/objectWithoutPropertiesLoose'的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在处理Reaction的一个项目,在实现此程序包后https://www.npmjs.com/package/react-bootstrap-typeahead出现以下错误。

Failed to compile

./node_modules/react-popper/lib/cjs/Popper.js
Module not found: Can't resolve '@babel/runtime/helpers/objectWithoutPropertiesLoose' in 'E:
eactjsdeveans-react-version
ode_modules
eact-popperlibcjs'

This error occurred during the build time and cannot be dismissed.

我找到了许多解决方案,我也尝试了https://github.com/jquense/yup/issues/216,但仍然遇到相同的错误。

但当我删除TypeAhead组件时,它工作正常。

import React , { Component } from 'react'
import {Typeahead} from 'react-bootstrap-typeahead';
import 'react-bootstrap-typeahead/css/Typeahead.css';
class States extends Component {

    state = {
        multiple: false,
        options: [
          {id: 1, label: 'Pakistan'},
          {id: 2, label: 'Indonesia'},
          {id: 3, label: 'Turkey'},
          {id: 4, label: 'Brazil'},
        ]
      };

    render () {

        const {multiple} = this.state;

        return (
          <div>
            <Typeahead
            labelKey="label"
            multiple={multiple}
            options={this.state.options}
            placeholder="Choose a state..."
          />
          </div>
        )
    }
}
export default States

推荐答案

我找到了解决方案

NPM安装--save-exact@babel/time@7.0.0-beta.55

然后删除Package-json.lock文件和NODE_MODULES文件夹,然后使用NPM安装重新安装

适合我。

这篇关于如何修复-找不到模块:无法解析&#39;@babel/runtime/helpers/objectWithoutPropertiesLoose&#39;的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆