我正在嘗試在 Windows 上創建一個 react-native 專案,但我收到了這個錯誤。
TypeError: cli.init is not a function
at run (C:\Users\oktay\AppData\Roaming\npm\node_modules\react-native-cli\index.js:302:7)
at createProject (C:\Users\oktay\AppData\Roaming\npm\node_modules\react-native-cli\index.js:249:3)
at init (C:\Users\oktay\AppData\Roaming\npm\node_modules\react-native-cli\index.js:200:5)
at Object.<anonymous> (C:\Users\oktay\AppData\Roaming\npm\node_modules\react-native-cli\index.js:153:7)
at Module._compile (node:internal/modules/cjs/loader:1155:14)
at Object.Module._extensions..js (node:internal/modules/cjs/loader:1209:10)
at Module.load (node:internal/modules/cjs/loader:1033:32)
at Function.Module._load (node:internal/modules/cjs/loader:868:12)
at Function.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:81:12)
at node:internal/main/run_main_module:22:47
基于 react native 檔案,我嘗試使用以下命令創建一個專案。
npx react-native init AwesomeProject
npm 版本:8.19.2
react-native-cli 版本:2.0.1
uj5u.com熱心網友回復:
用這個。
npx 創建反應本機應用程式
Npm 檔案: https ://www.npmjs.com/package/create-react-native-app
轉載請註明出處,本文鏈接:https://www.uj5u.com/yidong/520670.html
標籤:反应视窗本国的
