gpt4 book ai didi

windows - Windows 10 上的 react-native cli 工具语法错误

转载 作者:可可西里 更新时间:2023-11-01 09:36:45 25 4
gpt4 key购买 nike

当尝试从 Windows 10 计算机运行“react-native”时,它返回语法错误:

C:\Users\josetapadas\githubissue\node_modules\react-native\packager\react-packager\src\node-haste\index.js:40
constructor({
^

SyntaxError: Unexpected token {
at exports.runInThisContext (vm.js:53:16)
at Module._compile (module.js:373:25)
at Module._extensions..js (module.js:416:10)
at Object.require.extensions.(anonymous function) [as .js] (C:\Users\José Alves\src\AwesomeProject\node_modules\react-native\node_modules\babel-register\lib\node.js:154:7)
at Module.load (module.js:343:32)
at Function.Module._load (module.js:300:12)
at Module.require (module.js:353:17)
at require (internal/module.js:12:17)
at Object.<anonymous> (C:\Users\José Alves\src\AwesomeProject\node_modules\react-native\local-cli\server\util/attachHMRServer.js:11:34)
at Module._compile (module.js:409:26)

我基本上已经下载了 react-native-cli 并尝试引导一个新项目。

npm install -g react-native-cli
react-native

这些是我现在在我的 Windows 10 机器上安装的以下版本:

  • react-native-cli: 1.0.0
  • native react :0.33.0
  • 节点:v4.4.6

此错误是否影响到任何人以及任何人知道如何解决它?

谢谢!

最佳答案

这应该在 react-native 0.41 及更高版本中得到修复。

关于windows - Windows 10 上的 react-native cli 工具语法错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/39632926/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com