一、问题: 在react-native init appDemo 创建项目时,报错TypeError: cli.init is not a function。 二、解决: 产生这个问题的原因是:使用这种方式创建工程,react-native版本是0.69 版本上不适用。可以检查下自己安装的React-native的版本。 使用:npx react-native init Demo --version 0.68.2 即可。 解决方法不...
1. 在react-native init appDemo 创建项目时,报错TypeError: cli.init is not a function. 2. 解决:产生这个问题的原因是:使用这种方式创建工程,react-native版本是0.69 版本上不适用。各位可以检查下自己安装的React-native的版本。改成:npx react-native init chapter2 --version 0.68.2 即可。 对于69以上的...
TypeError: cli.init is not a function 报错原因:react-native版本不兼容这种写法,当react-native版本 大于等于 0.69时,便不适用。 解决方案:安装0.69以下的版本。 比如: react-nativeinit xxx --version 0.68.2
TypeError: cli.init is not a function at run (C:\dev\node-v14.17.5-win-x64\node-v14.17.5-win-x64\node_modules\react-native-cli\index.js:302:7) at createProject (C:\dev\node-v14.17.5-win-x64\node-v14.17.5-win-x64\node_modules\react-native-cli\index.js:249:3) at init (C...
$ react-native init AwesomeProject.../usr/local/lib/node_modules/react-native-cli/index.js:302cli.init(root,projectName);^TypeError:cli.init is not afunctionatrun(/usr/local/lib/node_modules/react-native-cli/index.js:302:7)atcreateProject(/usr/local/lib/node_modules/react-native-cli/index...
/usr/local/lib/node_modules/react-native-cli/index.js:302 cli.init(root, projectName); ^ TypeError: cli.init is not a function at run (/usr/local/lib/node_modules/react-native-cli/index.js:302:7) at createProject (/usr/local/lib/node_modules/react-native-cli/index.js:249:3) at ...
在MacBook air M1 芯片中运行 npx react-native init appName TypeError: cli.init is not a function at run (/opt/homebrew/lib/node_modules/react-native-cli/index.js:302:7) at createProject (/opt/homebrew/lib/node_modules/react-native-cli/index.js:249:3) at init (/opt/homebrew/lib/node...
cli.init(root, projectName); ^ TypeError: cli.init is not a function at run (/Users/user/.config/yarn/global/node_modules/react-native-cli/index.js:302:7) at createProject (/Users/user/.config/yarn/global/node_modules/react-native-cli/index.js:249:3) ...
这是新版本0.69.0的错误。您可以使用npx react-native init ProjectName --version 0.68.2,然后...
The error TypeError: cli.init is not a function occurs when you have an outdated, globally installed version of the React native CLI.