1.Failing run on IOS and Android because a syntax error in `local-cli
错误描述:
having the same issue
react-native run-ios
/Users/admin/workspace/aelamd/node_modules/react-native/local-cli/server/checkNodeVersion.js:43
);
^
SyntaxError: Unexpected token )
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. (/Users/admin/workspace/aelamd/node_modules/react-native/local-cli/cli.js:17:1)
解决方法:使用
nvm install v9.0.0
nvm alias default v9.0.0
2.安装指定版本的watchman
3.Application XXX has not been registered.
4.端口被占用,8081端口总是被占用。
查看是哪个进程在占用这个端口
CNyanpliu:VideoDemo yanpliu$ lsof -i:8081
通过kill pid 就能杀死该进程。