I just wanted to create a new NextJS Project using yarn create next-app <project-name>, but at the "installing dependencies" step, yarn fails with the following error message:
error https://registry.yarnpkg.com/@next/swc-linux-arm-gnueabihf/-/swc-linux-arm-gnueabihf-12.0.4.tgz: incorrect data check [same error with different packages] error https://registry.yarnpkg.com/next/-/next-12.0.4.tgz: Extracting tar content of undefined failed, the file appears to be corrupt: "Invalid tar header. Maybe the tar is corrupted or it needs to be gunzipped?" info Visit https://yarnpkg.com/en/docs/cli/add for documentation about this command. error https://registry.yarnpkg.com/@next/swc-linux-arm64-gnu/-/swc-linux-arm64-gnu-
I also get this error when normally trying to install npm packages with yarn. Apparently this seems to be some error with extracting some tar files, but I'm not sure about the exact cause of the error and how to fix it. Reinstalling yarn did unfortunately not fix the error. How can I fix this?
Edit: Using npm doesn't work as well, and I get the following error:
npm WARN tar zlib: incorrect data check npm WARN tarball tarball data for @next/swc-darwin-x64@https://registry.npmjs.org/@next/swc-darwin-x64/-/swc-darwin-x64-12.0.4.tgz (sha512-PVgefMWjxP6CU1HQs39+Bfpjcue6qErJfvJ/+n2zimjLzyeQAmD6LM9f1lDSttW2LjKjasoxR5qkRNLVlqzlaA==) seems to be corrupted. Trying again. npm ERR! code Z_DATA_ERROR npm ERR! errno -3 npm ERR! zlib: incorrect data check