Tried every possible step
- Reinstalled Node, NPM, Expo, etc.
- Cleaned Cache, verified it aswell.
- Please help or I would have to reinstall Ubuntu.
faisal@PC:~$ expo init
Migrate to using:
› npx create-expo-app --template
✔ What would you like to name your app? … my-app
✔ Choose a template: › blank a minimal app as clean as an empty canvas
Error downloading and extracting template package: TypeError: Cannot read properties of null (reading '0')
✖ Something went wrong while downloading and extracting the template.
Can't read JSON file: /home/faisal/my-app/app.json
└─ Cause: Error: ENOENT: no such file or directory, open '/home/faisal/my-app/app.json'
├─ readAsync /usr/local/lib/node_modules/expo-cli/node_modules/@expo/json-file/src/JsonFile.ts:158:13
├─ extractAndPrepareTemplateAppAsync /usr/local/lib/node_modules/expo-cli/src/commands/utils/extractTemplateAppAsync.ts:25:25
└─ actionAsync /usr/local/lib/node_modules/expo-cli/src/commands/initAsync.ts:290:19
faisal@PC:~$ npx create-expo-app myapp
✖ Something went wrong in downloading and extracting the project files: Could not find npm package "expo-template-blank@latest"
Error cloning template: Error: Could not find npm package "expo-template-blank@latest"
faisal@PC:~$ npm ls -g
/usr/local/lib
+-- @angular/[email protected]
+-- [email protected]
+-- [email protected]
`-- [email protected]
faisal@PC:~$ npm -v
8.19.2
2
Answers
Reinstalled Node using NVM
Apparently the node I installed multiple times through the store was giving the error so I decided to use the Node Version Manager instead.
Instructions:
And yes, it works:
If you previously installed a global react-native-cli package, please remove it as it may cause unexpected issues:
Run this command
npm uninstall -g react-native-cli @react-native-community/cli
Start a new project
npx react-native init AwesomeProject