在 .babelrc 文件中指定了未知插件,尝试相对于路径进行解析。

4
我开始了一个新的react-native项目,并从我的以前的项目中复制了.babelrc文件。我安装了必要的插件,但是遇到了错误:
Unknown plugin transform-decorators-legacy specified in .babelrc, attempted to resolve relative to "/mypath/project"
我检查了路径中的node_modules,并看到插件是使用安装的。 我的eslint插件也出现了类似的错误。 我在项目设置中是否少了什么,导致babel和eslint看不到node_modules?
这可能是由于安装了react-native-code-push引起的吗? 我认为在安装codepush时会发生一些错误,其中duplicated the react pod in the pod install,所以我将其从podfile中删除了。即使我在react js文件中没有实现code push,它是否仍在尝试使用缓存的code-push js?
3个回答

0

trasnform-decorators-legacy

这里有一个打字错误。


我在复制到stackoverflow时出现了转录错误,我已经在我的问题中修正了拼写错误,但错误仍然存在。 - MonkeyBonkey

0

试试这个:

yarn add babel-plugin-transform-decorators-legacy -g

0

对于 NPM:

npm install --save babel-plugin-transform-decorators-legacy


网页内容由stack overflow 提供, 点击上面的
可以查看英文原文,
原文链接