Vladislav
Vladislav

Reputation: 71

Expo create new project error when type npx create-expo-app

I try to create a new project for React Native using Expo but get an error, I write the following comands:

npx create-expo-app ✔ What is your app named? … Test 
✖ Something went wrong in downloading and extracting the project files: npm pack expo-template-default@latest --dry-run --json exited with non-zero code: 1 
Error: npm pack expo-template-default@latest --dry-run --json exited with non-zero code: 1

I tried to reinstall node JS. Now it's node v20.13.1, npm v10.8.0. I work on Ubuntu 22.04.4 LTS Nothing helped me. When I write npm pack expo-template-default@latest --dry-run --json then see the following answer:

npm error code E404
npm error 404 Not Found - GET https://npm.pkg.github.com/expo-template-blank/-/expo-template-blank-51.0.27.tgz
npm error 404
npm error 404  'https://registry.npmjs.org/expo-template-blank/-/expo-template-blank-51.0.27.tgz' is not in this registry.
npm error 404 This package name is not valid, because 
npm error 404  1. name can only contain URL-friendly characters
npm error 404
npm error 404 Note that you can also install from a
npm error 404 tarball, folder, http url, or git url.
{
  "error": {
    "code": "E404",
    "summary": "Not Found - GET https://npm.pkg.github.com/expo-template-blank/-/expo-template-blank-51.0.27.tgz",
    "detail": "'https://registry.npmjs.org/expo-template-blank/-/expo-template-blank-51.0.27.tgz' is not in this registry.\nThis package name is not valid, because \n 1. name can only contain URL-friendly characters\n\nNote that you can also install from a\ntarball, folder, http url, or git url."
  }
}

Has anyone faced this problem? I have no idea how to fix it. Thanks

Upvotes: 3

Views: 2307

Answers (3)

Jabastin
Jabastin

Reputation: 1

Actually, you need to completely delete the node JS and it's path in the environment variable. Then try again it will work.

Upvotes: 0

Vladislav
Vladislav

Reputation: 71

I spend a few days to fix this problem. As a result I found that need to change npm configurations, so I typed the following command and this fixed the problem.

npm config set registry http://registry.npmjs.org

Upvotes: 4

Nana Asare
Nana Asare

Reputation: 51

Try using yarn instead of npx, it worked for me. If yarn requires permissions; use sudo yarn.

So it should be something like this:

sudo yarn create expo-app appName --template blank

Upvotes: 2

Related Questions