我正在编写一个NPM模块,其中包含一些React组件,并具有@ babel / core 7作为依赖项。我正在通过(通过npm link
将该模块链接到现有项目并尝试从该模块导入组件来在本地测试该模块。但是在运行时,出现以下错误:
Module build failed: Error: Requires Babel "^7.0.0-0", but was loaded with "6.26.3". If you are sure you have a compatible version of @babel/core, it is likely that something in your build process is loading the wrong version.
我现有的项目及其所有依赖项都比较旧,并且仍使用babel6。在不升级到babel 7的情况下,我有什么办法解决这个问题?谢谢!