无法从“ node_modules \ expo \ AppEntry.js”解析“ ../../artifacts/App”

时间:2019-11-29 13:06:25

标签: node.js react-native expo

有时我会因为这个错误而陷入困境。有人可以帮忙解决这个错误吗?
每次执行升级博览会时,总会遇到T__T问题。

transform[stderr]: Trace: The node type SpreadProperty has been renamed to SpreadElement
transform[stderr]:     at Object.isSpreadProperty (C:\+Beta\PandaMarketMobile\node_modules\@babel\types\lib\validators\generated\index.js:4512:11)
transform[stderr]:     at hasSpread (C:\+Beta\PandaMarketMobile\node_modules\babel-plugin-transform-object-rest-spread\lib\index.js:38:13)
transform[stderr]:     at PluginPass.ObjectExpression (C:\+Beta\PandaMarketMobile\node_modules\babel-plugin-transform-object-rest-spread\lib\index.js:234:14)
transform[stderr]:     at newFn (C:\+Beta\PandaMarketMobile\node_modules\@babel\traverse\lib\visitors.js:179:21)
transform[stderr]:     at NodePath._call (C:\+Beta\PandaMarketMobile\node_modules\@babel\traverse\lib\path\context.js:55:20)
transform[stderr]:     at NodePath.call (C:\+Beta\PandaMarketMobile\node_modules\@babel\traverse\lib\path\context.js:42:17)
transform[stderr]:     at NodePath.visit (C:\+Beta\PandaMarketMobile\node_modules\@babel\traverse\lib\path\context.js:90:31)
transform[stderr]:     at TraversalContext.visitQueue (C:\+Beta\PandaMarketMobile\node_modules\@babel\traverse\lib\context.js:112:16)
transform[stderr]:     at TraversalContext.visitSingle (C:\+Beta\PandaMarketMobile\node_modules\@babel\traverse\lib\context.js:84:19)
transform[stderr]:     at TraversalContext.visit (C:\+Beta\PandaMarketMobile\node_modules\@babel\traverse\lib\context.js:140:19)
Error
21:00
Unable to resolve "../../artifacts/App" from "node_modules\expo\AppEntry.js"
Error
21:00
Building JavaScript bundle: error

1 个答案:

答案 0 :(得分:-1)

检查您的app.json文件是否在“ sourceExts”中声明了正确的扩展名

示例:

"packageOpts": {
  "sourceExts": ["js", "json", "ts", "tsx", "jsx"],
  // other configs
}