skip to Main Content

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 charactersnnNote that you can also install from antarball, folder, http url, or git url."
  }
}

`

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

2

Answers


  1. Chosen as BEST ANSWER

    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
    

  2. 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

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search