# μ—λŸ¬ ν•΄κ²°πŸ”‘ react native template typescript An unexpected error occurred: "https://registry.yarnpkg.com/react-native-template-react-native-template-typescript: Not found"

λ¦¬μ•‘νŠΈ λ„€μ΄ν‹°λΈŒλ₯Ό νƒ€μž…μŠ€ν¬λ¦½νŠΈ ν…œν”Œλ¦ΏμœΌλ‘œ μΆ”κ°€ν•  λ•Œ λ°œμƒν•˜λŠ” μ—λŸ¬.

  1. remove legacy react-native-cli npm uninstall -g react-native-cli

  2. install new thing npm i -g @react-native-community/cli

  3. and you can new project with react-native-template-typescript npx react-native init MyApp --template react-native-template-typescript

  • 2μ—μ„œ npm ERR! code EACCES μ—‘μ„ΈμŠ€ μ ‘κ·Ό μ—λŸ¬κ°€ λ‚˜λ©΄ npm μ•žμ— sudoλ₯Ό λΆ™μ—¬μ„œ μ ‘κ·Ό κΆŒν•œμ„ ν—ˆμš©ν•΄μ€€λ‹€.
  • sudo둜 μ ‘κ·Ό κΆŒν•œμ΄ μžˆμŒμ—λ„, "npm ERR! EEXIST: file already exists, symlink '../lib/node_modules/react-native-cli/index.js' -> '/usr/local/bin/react-native' npm ERR! File exists: /usr/local/bin/react-native"와 같은 μ—λŸ¬κ°€ λ‚˜λ©΄ ν•΄λ‹Ή /usr/local/bin/react-native 폴더λ₯Ό μ‚­μ œν•œ ν›„ λ‹€μ‹œ μ„€μΉ˜ν•΄λ³Έλ‹€.

# reference

https://lifesaver.codes/answer/an-unexpected-error-occurred-https-registry-yarnpkg-com-react-native-template-react-native-template-typescript-not-found-72 (opens new window)

Last Updated: a year ago