我在 package.json 中添加了一个脚本命令,如下所示:
"ios": "sh config.sh && react-native run-ios"
当我在没有纱线的情况下执行此命令时,该命令运行良好。
但是当我尝试使用yarn ( yarn run ios或yarn ios ) 执行它时...该命令执行良好,但 Metro bundler 因给定错误而失败:
/Users/ano/mols/node_modules/@react-native-community/cli/build/index.js:154
const cmd = _commander().default.command(command.name).action(async function handleAction(...args) {
^^^^^
SyntaxError: missing ) after argument list
at createScript (vm.js:56:10)
at Object.runInThisContext (vm.js:97:10)
at Module._compile (module.js:542:28)
at Object.Module._extensions..js (module.js:579:10)
at Module.load (module.js:487:32)
at tryModuleLoad (module.js:446:12)
at Function.Module._load (module.js:438:3)
at Module.require (module.js:497:17)
at require (internal/module.js:20:19)
at Object.<anonymous> (/Users/ano/mols/node_modules/react-native/cli.js:13:11)
Process terminated. Press <enter> to close the window
有谁知道发生了什么?谢谢。