简体   繁体   English

错误代码 253 在 mac m1 上运行 npx react-native init

[英]Error code 253 running npx react-native init on mac m1

Error appear when running this command: npx react-native init awesomeproject运行此命令时出现错误: npx react-native init awesomeproject

npm version: 6.14.15 npm 版本:6.14.15

node version: v14.17.6节点版本:v14.17.6

npm ERR! code Z_DATA_ERROR
npm ERR! errno -3
npm ERR! zlib: incorrect data check

npm ERR! A complete log of this run can be found in:
npm ERR!     /Users/name/.npm/_logs/2022-03-11T17_06_48_110Z-debug.log
Install for [ 'react-native@latest' ] failed with code 253

I can't find any solutions for this problem.我找不到这个问题的任何解决方案。 Does anyone know how to fix this error?有谁知道如何解决这个错误?

Any help is appreciated!任何帮助表示赞赏! thanks in advance提前致谢

Clear your cache清除缓存

npm cache clean --force

And update your npm并更新您的 npm

npm install -g npm@latest

Also, install nvm and use the latest LTS version of node另外,安装 nvm 并使用最新的 LTS 版本的节点

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM