React Native:错误:捆绑失败:index.js:“”不是有效的标识符名称

我有一个React Native应用程序,今天早上运行得非常好。错误地执行了package-lock.json而不是npm install后,我删除了yarn install。然后我运行了yarn install,现在当我尝试运行我的应用程序时,我在打包机上收到此错误:

error: bundling failed: index.js: "" is not a valid identifer name
BUNDLE  [ios,dev] ./index.js ░░░░░░░░░░░░░░░░ 0.0% (0/1),failed.

我也关闭了打包程序和Vscode,删除了node_modules并尝试再次运行yarn install,但是遇到了同样的错误。我没有在代码中更改任何一行,并且在此之前它可以正常工作。

这是怎么回事?

wcnm2132 回答:React Native:错误:捆绑失败:index.js:“”不是有效的标识符名称

它已作为问题打开。

https://github.com/facebook/react-native/issues/27118

https://github.com/facebook/react-native/issues/27120#issuecomment-549832676

仅需删除“ node_modules”,然后再次运行命令:

npm iyarn

此外,您可以使用以下方法重新创建草稿项目

react-native init example

它将按预期工作。他们将@ babel / run-time的更改还原为7.7.1版本。

玩得开心??

,

删除node_modules和packages-lock.json,清除垃圾,关闭Metro Bundle,从模拟器/模拟器中删除应用程序并运行npm install,这种方式对我有用。

,

我遇到了同样的问题,这里或链接中没有提到的解决方案对我有用。问题是ValueError Traceback (most recent call last) <ipython-input-56-38cc921c1724> in <module>() 10 #image = Image.open(si) 11 #print(type(image)) ---> 12 ax[i,j].plot(image) 13 plt.show() 3 frames /usr/local/lib/python3.6/dist-packages/matplotlib/axes/_base.py in _xy_from_xy(self,x,y) 271 if x.ndim > 2 or y.ndim > 2: 272 raise ValueError("x and y can be no greater than 2-D,but have " --> 273 "shapes {} and {}".format(x.shape,y.shape)) 274 275 if x.ndim == 1: ValueError: x and y can be no greater than 2-D,but have shapes (64,) and (64,64,3) 的本地版本和全局版本不同。

react-native为我工作。

并且在捆绑时,node node_modules/react-native/local-cli/cli.js run-ios

简而言之,尝试运行或捆绑时将node node_modules/react-native/local-cli/cli.js bundle --entry-file...替换为react-native

本文链接:https://www.f2er.com/3159866.html

大家都在问