Fai*_*sal 3 npm react-native expo
faisal@PC:~$ expo init\n\nMigrate to using:\n\xe2\x80\xba npx create-expo-app --template\n\n\xe2\x9c\x94 What would you like to name your app? \xe2\x80\xa6 my-app\n\xe2\x9c\x94 Choose a template: \xe2\x80\xba blank a minimal app as clean as an empty canvas\nError downloading and extracting template package: TypeError: Cannot read properties of null (reading '0')\n\xe2\x9c\x96 Something went wrong while downloading and extracting the template.\n\nCan't read JSON file: /home/faisal/my-app/app.json\n\xe2\x94\x94\xe2\x94\x80 Cause: Error: ENOENT: no such file or directory, open '/home/faisal/my-app/app.json'\n \xe2\x94\x9c\xe2\x94\x80 readAsync /usr/local/lib/node_modules/expo-cli/node_modules/@expo/json-file/src/JsonFile.ts:158:13\n \xe2\x94\x9c\xe2\x94\x80 extractAndPrepareTemplateAppAsync /usr/local/lib/node_modules/expo-cli/src/commands/utils/extractTemplateAppAsync.ts:25:25\n \xe2\x94\x94\xe2\x94\x80 actionAsync /usr/local/lib/node_modules/expo-cli/src/commands/initAsync.ts:290:19\nfaisal@PC:~$ npx create-expo-app myapp\n\xe2\x9c\x96 Something went wrong in downloading and extracting the project files: Could not find npm package "expo-template-blank@latest"\nError cloning template: Error: Could not find npm package "expo-template-blank@latest"\nfaisal@PC:~$ npm ls -g\n/usr/local/lib\n+-- @angular/cli@14.2.3\n+-- expo-cli@6.0.5\n+-- expo-template-blank@46.0.21\n`-- npm@8.19.2\n\nfaisal@PC:~$ npm -v\n8.19.2\nRun Code Online (Sandbox Code Playgroud)\n
显然,我通过商店多次安装的节点出现了错误,因此我决定改用节点版本管理器。
\ncurl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.38.0/install.sh\nRun Code Online (Sandbox Code Playgroud)\ncurl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.38.0/install.sh | bash\nRun Code Online (Sandbox Code Playgroud)\nsource ~/.bashrc\nRun Code Online (Sandbox Code Playgroud)\nnvm list-remote\nRun Code Online (Sandbox Code Playgroud)\nnvm install v16.17.1\nRun Code Online (Sandbox Code Playgroud)\n是的,它有效:
\nfaisal@pc:~$ nvm install v16.17.1\nDownloading and installing node v16.17.1...\nDownloading https://nodejs.org/dist/v16.17.1/node-v16.17.1-linux-x64.tar.xz...\n######################################################################################################################################################################### 100.0%\nComputing checksum with sha256sum\nChecksums matched!\nNow using node v16.17.1 (npm v8.15.0)\nCreating default alias: default -> v16.17.1\nfaisal@pc:~$ expo init\n\nMigrate to using:\n\xe2\x80\xba npx create-expo-app --template\n\n\xe2\x9c\x94 What would you like to name your app? \xe2\x80\xa6 my-app\n\xe2\x9c\x94 Choose a template: \xe2\x80\xba blank a minimal app as clean as an empty canvas\n\xe2\x9c\x94 Downloaded template.\n Using npm to install packages.\n\xe2\x9c\x94 Installed JavaScript dependencies.\n\n\xe2\x9c\x85 Your project is ready!\n\nTo run your project, navigate to the directory and run one of the following npm commands.\n\n- cd my-app\n- npm start # you can open iOS, Android, or web from here, or run them directly with the commands below.\n- npm run android\n- npm run ios # requires an iOS device or macOS for access to an iOS simulator\n- npm run web\nRun Code Online (Sandbox Code Playgroud)\n
| 归档时间: |
|
| 查看次数: |
5728 次 |
| 最近记录: |